/* 
 * Controlled Drug Log - Stylesheet
 * Native-like mobile app interface with premium glassmorphic styling
 */

:root {
    --bg-main: #f0f4f9;
    --bg-header: rgba(255, 255, 255, 0.8);
    --panel-bg: rgba(255, 255, 255, 0.7);
    --panel-border: rgba(28, 100, 242, 0.1);
    
    --primary: #1c64f2;
    --primary-glow: rgba(28, 100, 242, 0.15);
    --primary-grad: linear-gradient(135deg, #1c64f2 0%, #1a56db 100%);
    
    --success: #0e9f6e;
    --success-glow: rgba(14, 159, 110, 0.15);
    --success-grad: linear-gradient(135deg, #0e9f6e 0%, #057a55 100%);
    
    --error: #f05252;
    --error-glow: rgba(240, 82, 82, 0.15);
    
    --text-primary: #111928;
    --text-secondary: #4b5563;
    --text-muted: #9ca3af;
    --input-bg: rgba(255, 255, 255, 0.9);
    --input-border: rgba(28, 100, 242, 0.2);
    
    --radius-sm: 8px;
    --radius-md: 14px;
    --radius-lg: 20px;
    
    --transition-smooth: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Global Reset & Base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: 'Outfit', sans-serif;
    background-color: var(--bg-main);
    color: var(--text-primary);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    overflow-x: hidden;
    background-image: 
        radial-gradient(circle at 10% 20%, rgba(28, 100, 242, 0.08) 0%, transparent 40%),
        radial-gradient(circle at 90% 80%, rgba(14, 159, 110, 0.05) 0%, transparent 45%);
    background-attachment: fixed;
}

/* Container Structure */
.app-wrapper {
    width: 100%;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    position: relative;
    background: #ffffff;
}

/* App Header */
.app-header {
    background: var(--bg-header);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--panel-border);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-main {
    padding: 16px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.brand {
    display: flex;
    align-items: center;
    gap: 12px;
}

.brand-logo {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-md);
    background: var(--primary-grad);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.2rem;
    box-shadow: 0 4px 15px var(--primary-glow);
}

.brand-text h1 {
    font-size: 1.1rem;
    font-weight: 700;
    letter-spacing: -0.3px;
    line-height: 1.2;
}

.brand-text span {
    font-size: 0.75rem;
    color: var(--text-secondary);
    font-weight: 400;
}

.header-status-bar {
    padding: 6px 20px;
    background: rgba(0, 0, 0, 0.15);
    border-top: 1px solid rgba(255, 255, 255, 0.03);
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.75rem;
}

.status-indicator {
    display: flex;
    align-items: center;
    gap: 6px;
    color: var(--text-secondary);
}

.pulse-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    display: inline-block;
}

.pulse-dot.green {
    background-color: var(--success);
    box-shadow: 0 0 8px var(--success);
    animation: pulse 2s infinite;
}

.pulse-dot.orange {
    background-color: #f59e0b;
    box-shadow: 0 0 8px rgba(245, 158, 11, 0.5);
    animation: pulse 2s infinite;
}

.active-staff-indicator {
    display: flex;
    align-items: center;
    gap: 6px;
    background: rgba(99, 102, 241, 0.15);
    color: var(--primary);
    padding: 2px 8px;
    border-radius: 10px;
    border: 1px solid rgba(99, 102, 241, 0.2);
    font-weight: 600;
}

/* Form Container */
.form-container {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}

form {
    display: flex;
    flex-direction: column;
    flex: 1;
}

/* Steps Transition */
.form-step {
    display: none;
    flex-direction: column;
    animation: slideIn 0.35s cubic-bezier(0.16, 1, 0.3, 1) forwards;
    flex: 1;
}

.form-step.active {
    display: flex;
}

.step-header {
    margin-bottom: 24px;
}

.step-header h2 {
    font-size: 1.4rem;
    font-weight: 600;
    margin-bottom: 6px;
    letter-spacing: -0.2px;
}

.step-header p {
    font-size: 0.9rem;
    color: var(--text-secondary);
}

/* Glassmorphic Panel UI */
.glass-panel {
    background: var(--panel-bg);
    border: 1px solid var(--panel-border);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-radius: var(--radius-lg);
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.25);
}

.sub-panel {
    background: rgba(15, 23, 42, 0.4);
}

/* Forms Elements */
.form-group {
    margin-bottom: 16px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.form-row {
    display: flex;
    gap: 15px;
}

.form-row .form-group {
    flex: 1;
}

label {
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

input[type="text"],
input[type="number"],
input[type="date"],
input[type="url"] {
    width: 100%;
    background: var(--input-bg);
    border: 1px solid var(--input-border);
    border-radius: var(--radius-md);
    padding: 14px 16px;
    color: var(--text-primary);
    font-family: inherit;
    font-size: 1rem;
    outline: none;
    transition: var(--transition-smooth);
}

input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
}

/* Number Input wrapper */
.number-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.number-input-wrapper input {
    padding-right: 45px;
}

.number-input-wrapper .unit {
    position: absolute;
    right: 16px;
    color: var(--text-muted);
    font-size: 0.9rem;
    font-weight: 600;
    pointer-events: none;
}

/* Page 1: Authentication (PIN) */
.pin-input-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 30px;
}

.pin-display {
    display: flex;
    gap: 18px;
    justify-content: center;
    margin-bottom: 12px;
}

.pin-dot {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    border: 2px solid var(--text-muted);
    transition: var(--transition-smooth);
}

.pin-dot.filled {
    background-color: var(--primary);
    border-color: var(--primary);
    box-shadow: 0 0 12px var(--primary);
    transform: scale(1.15);
}

.pin-dot.error {
    background-color: var(--error);
    border-color: var(--error);
    box-shadow: 0 0 12px var(--error);
    transform: scale(1.15);
    animation: shake 0.3s;
}

#pin-field {
    display: none;
}

.pin-feedback {
    font-size: 0.85rem;
    height: 20px;
    font-weight: 500;
    text-align: center;
    transition: var(--transition-smooth);
}

.pin-feedback.success { color: var(--success); }
.pin-feedback.error { color: var(--error); }

.pin-keypad {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    max-width: 320px;
    margin: 0 auto;
}

.key {
    width: 68px;
    height: 68px;
    border-radius: 50%;
    background: #f0f4f9;
    border: 1px solid #e1e8f0;
    color: var(--text-primary);
    font-size: 1.6rem;
    font-weight: 500;
    font-family: inherit;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    margin: 0 auto;
    transition: all 0.15s ease;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
}

.key:active {
    background: rgba(28, 100, 242, 0.15);
    border-color: var(--primary);
    transform: scale(0.92);
}

.key.clear {
    color: var(--text-muted);
    font-size: 1.3rem;
}

.key.delete {
    color: var(--text-muted);
    font-size: 1.3rem;
}

/* Page 2: Drug Selection */
.drug-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    margin-bottom: 20px;
}

.drug-card {
    cursor: pointer;
    position: relative;
    border-radius: var(--radius-md);
    overflow: hidden;
}

.drug-card input[type="radio"] {
    display: none;
}

.drug-card-content {
    background: var(--panel-bg);
    border: 1px solid var(--panel-border);
    border-radius: var(--radius-md);
    padding: 16px 12px;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    transition: var(--transition-smooth);
    min-height: 110px;
    justify-content: center;
}

.drug-icon {
    font-size: 1.8rem;
    color: var(--text-secondary);
    transition: var(--transition-smooth);
}

.drug-card-content h3 {
    font-size: 0.95rem;
    font-weight: 600;
    line-height: 1.2;
}

.drug-type {
    font-size: 0.7rem;
    color: var(--text-muted);
    font-weight: 500;
    text-transform: uppercase;
}

/* Drug selected state */
.drug-card input[type="radio"]:checked + .drug-card-content {
    background: rgba(99, 102, 241, 0.12);
    border-color: var(--primary);
    box-shadow: 0 0 15px rgba(99, 102, 241, 0.2);
    transform: translateY(-2px);
}

.drug-card input[type="radio"]:checked + .drug-card-content .drug-icon {
    color: var(--primary);
    transform: scale(1.1);
}

.other-card .drug-icon {
    color: var(--success);
}
.other-card input[type="radio"]:checked + .drug-card-content {
    background: rgba(16, 185, 129, 0.1);
    border-color: var(--success);
    box-shadow: 0 0 15px rgba(16, 185, 129, 0.2);
}

/* Page 3: Bottle Management */
.bottle-info-card {
    padding: 20px;
    margin-bottom: 20px;
}

.bottle-info-card .card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    padding-bottom: 12px;
}

.badge {
    background: var(--primary);
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    color: white;
}

.status-pill {
    font-size: 0.8rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 5px;
}

.status-pill.active { color: var(--success); }

.info-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px 12px;
}

.info-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.info-item.highlight {
    grid-column: span 2;
    background: rgba(255, 255, 255, 0.02);
    padding: 10px 14px;
    border-radius: var(--radius-md);
    border-left: 3px solid var(--primary);
    margin-top: 4px;
}

.info-item .label {
    font-size: 0.75rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.info-item .value {
    font-size: 1rem;
    font-weight: 600;
}

.info-item.highlight .value {
    font-size: 1.4rem;
    color: var(--text-primary);
}

/* Switches & Toggles */
.toggle-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 15px;
}

.toggle-text h3 {
    font-size: 0.95rem;
    font-weight: 600;
    margin-bottom: 3px;
}

.toggle-text p {
    font-size: 0.78rem;
    color: var(--text-secondary);
}

.switch {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 28px;
    flex-shrink: 0;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0; left: 0; right: 0; bottom: 0;
    background-color: rgba(255, 255, 255, 0.1);
    transition: .3s;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.slider:before {
    position: absolute;
    content: "";
    height: 20px;
    width: 20px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: .3s;
    box-shadow: 0 2px 6px rgba(0,0,0,0.4);
}

input:checked + .slider {
    background-color: var(--primary);
}

input:checked + .slider:before {
    transform: translateX(22px);
}

.slider.round {
    border-radius: 34px;
}

.slider.round:before {
    border-radius: 50%;
}

.collapsible-section {
    transition: var(--transition-smooth);
}

.panel-subtitle {
    font-size: 0.95rem;
    font-weight: 600;
    margin-bottom: 14px;
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-primary);
}

/* Page 4: Usage & Calculations */
.total-deduction-card {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.total-deduction-card span {
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-secondary);
}

.total-deduction-card strong {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--primary);
}

/* Page 5: Review & Submit (Receipt) */
.review-ticket {
    padding: 0;
    overflow: hidden;
    position: relative;
}

.ticket-header {
    background: rgba(255, 255, 255, 0.02);
    padding: 16px 20px;
    border-bottom: 1px dashed rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    gap: 10px;
}

.ticket-header i {
    color: var(--primary);
    font-size: 1.1rem;
}

.ticket-header h3 {
    font-size: 0.95rem;
    font-weight: 600;
}

.ticket-body {
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.ticket-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.9rem;
}

.ticket-row .label {
    color: var(--text-secondary);
}

.ticket-row .value {
    font-weight: 500;
}

.ticket-row.total {
    border-top: 1px dashed rgba(255, 255, 255, 0.1);
    margin-top: 8px;
    padding-top: 12px;
}

.ticket-row.total .label {
    font-weight: 600;
    color: var(--text-primary);
}

.ticket-row.total .value {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--success);
}

.ticket-row.balance-estimate {
    background: rgba(28, 100, 242, 0.05);
    margin: 4px -20px -20px -20px;
    padding: 12px 20px;
    border-top: 1px solid rgba(28, 100, 242, 0.05);
}

.ticket-row.balance-estimate .label {
    font-size: 0.8rem;
}

.ticket-row.balance-estimate .value {
    color: var(--text-secondary);
    font-size: 0.85rem;
}

/* Buttons Controls */
.navigation-controls {
    display: flex;
    gap: 12px;
    margin-top: auto;
    padding-top: 20px;
}

.btn {
    flex: 1;
    font-family: inherit;
    font-size: 1rem;
    font-weight: 600;
    padding: 15px 20px;
    border-radius: var(--radius-md);
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    outline: none;
    transition: var(--transition-smooth);
}

.btn-primary {
    background: var(--primary-grad);
    color: white;
    box-shadow: 0 4px 15px var(--primary-glow);
}

.btn-primary:active {
    transform: scale(0.97);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.05);
    color: var(--text-secondary);
}

.btn-secondary:active {
    background: rgba(255, 255, 255, 0.08);
}

.btn-success {
    background: var(--success-grad);
    color: white;
    box-shadow: 0 4px 15px var(--success-glow);
}

.btn-success:active {
    transform: scale(0.97);
}

.icon-btn {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.05);
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition-smooth);
}

.icon-btn:hover, .icon-btn:active {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
}

/* Progress Footer */
.app-footer {
    padding: 16px 20px 24px 20px;
    background: rgba(13, 20, 35, 0.5);
    border-top: 1px solid var(--panel-border);
}

.progress-bar-container {
    position: relative;
    padding: 10px 0;
}

.progress-line {
    position: absolute;
    top: 50%;
    left: 8px;
    right: 8px;
    height: 3px;
    background: rgba(255, 255, 255, 0.08);
    transform: translateY(-50%);
    z-index: 1;
}

.progress-line-fill {
    height: 100%;
    background: var(--primary);
    transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.step-nodes {
    display: flex;
    justify-content: space-between;
    position: relative;
    z-index: 2;
}

.step-node {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: #1e293b;
    border: 2px solid var(--text-muted);
    color: var(--text-secondary);
    font-size: 0.72rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition-smooth);
}

.step-node.active {
    background: var(--bg-main);
    border-color: var(--primary);
    color: var(--primary);
    box-shadow: 0 0 10px rgba(99, 102, 241, 0.4);
}

.step-node.completed {
    background: var(--primary);
    border-color: var(--primary);
    color: white;
}

/* Modals */
.modal-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.modal-card {
    width: 100%;
    max-width: 380px;
    margin: 0 auto;
    animation: scaleUp 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    padding-bottom: 12px;
}

.modal-header h3 {
    font-size: 1.05rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
}

.close-btn {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 1.5rem;
    cursor: pointer;
}

.help-text {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.toggle-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.toggle-row strong {
    font-size: 0.9rem;
    font-weight: 600;
}

.toggle-row p {
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    padding-top: 15px;
}

/* Status overlays */
.status-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(240, 244, 249, 0.95);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.status-card {
    width: 100%;
    max-width: 320px;
    text-align: center;
    padding: 30px 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.status-card h3 {
    font-size: 1.25rem;
    margin: 20px 0 8px 0;
}

.status-card p {
    font-size: 0.88rem;
    color: var(--text-secondary);
}

/* Spinner */
.spinner-container {
    width: 60px;
    height: 60px;
    margin-bottom: 10px;
}

.modern-spinner {
    width: 100%;
    height: 100%;
    border: 4px solid rgba(99, 102, 241, 0.1);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

/* Checkmark Animation */
.success-checkmark {
    width: 80px;
    height: 80px;
    position: relative;
}

.check-icon {
    width: 80px;
    height: 80px;
    position: relative;
    border-radius: 50%;
    box-sizing: content-box;
    border: 4px solid var(--success);
}

.check-icon::before, .check-icon::after {
    content: '';
    position: absolute;
    background: transparent;
}

.icon-line {
    height: 5px;
    background-color: var(--success);
    display: block;
    border-radius: 2px;
    position: absolute;
    z-index: 10;
}

.icon-line.line-tip {
    top: 46px; left: 19px;
    width: 25px;
    transform: rotate(45deg);
    animation: writeTip 0.4s;
}

.icon-line.line-long {
    top: 38px; right: 18px;
    width: 47px;
    transform: rotate(-45deg);
    animation: writeLong 0.4s;
}

.icon-circle {
    top: -4px; left: -4px;
    position: absolute;
    width: 80px;
    height: 80px;
    border-radius: 50%;
    border: 4px solid rgba(16, 185, 129, 0.2);
    box-sizing: content-box;
    z-index: 1;
}

/* Error Cross */
.error-crossmark {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    border: 4px solid var(--error);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--error);
    font-size: 2.5rem;
    box-shadow: 0 0 15px rgba(239, 68, 68, 0.15);
}

/* Keyframes animations */
@keyframes pulse {
    0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7); }
    70% { transform: scale(1); box-shadow: 0 0 0 6px rgba(16, 185, 129, 0); }
    100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

@keyframes slideIn {
    0% { opacity: 0; transform: translateY(12px); }
    100% { opacity: 1; transform: translateY(0); }
}

@keyframes scaleUp {
    0% { opacity: 0; transform: scale(0.92); }
    100% { opacity: 1; transform: scale(1); }
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    20%, 60% { transform: translateX(-6px); }
    40%, 80% { transform: translateX(6px); }
}

@keyframes writeTip {
    0% { width: 0; left: 9px; top: 38px; }
    100% { width: 25px; left: 19px; top: 46px; }
}

@keyframes writeLong {
    0% { width: 0; right: 46px; top: 54px; }
    100% { width: 47px; right: 18px; top: 38px; }
}

/* History & Confirmation styles */
.history-card {
    max-height: 80vh;
    display: flex;
    flex-direction: column;
}

.history-body {
    overflow-y: auto;
    flex: 1;
    padding-right: 5px;
}

.history-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.history-item {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: var(--radius-md);
    padding: 12px 14px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    transition: var(--transition-smooth);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.02);
}

.history-item:active {
    background: #f1f5f9;
}

.history-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.history-patient {
    font-size: 0.95rem;
    font-weight: 600;
    color: #0f172a; /* high contrast slate-900 */
    text-align: left;
}

.history-meta {
    font-size: 0.75rem;
    color: #475569; /* high contrast slate-600 */
    text-align: left;
}

.history-drug-badge {
    background: rgba(28, 100, 242, 0.08);
    color: #1e40af; /* dark blue */
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 0.75rem;
    font-weight: 600;
    display: inline-block;
}

.history-volume {
    font-size: 0.95rem;
    font-weight: 700;
    color: #1d4ed8; /* bold blue */
}

.history-staff {
    background: #e2e8f0;
    color: #334155; /* dark grey */
    padding: 1px 6px;
    border-radius: 6px;
    font-size: 0.7rem;
    font-weight: 600;
}

.history-empty {
    text-align: center;
    color: var(--text-secondary);
    padding: 40px 10px;
    font-size: 0.9rem;
}

/* Keypad syncing/disabled state */
.pin-btn:disabled, .pin-btn.disabled,
.pin-btn[disabled] {
    opacity: 0.4;
    cursor: not-allowed;
    background: rgba(226, 232, 240, 0.4) !important;
    border-color: #cbd5e1 !important;
    color: #94a3b8 !important;
    box-shadow: none !important;
    transform: none !important;
    pointer-events: none;
}

/* Dashboard & Drug Specific History items styling */
.dashboard-item, .mini-log-item {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: var(--radius-sm);
    padding: 10px 12px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    font-size: 0.82rem;
    transition: var(--transition-smooth);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.01);
}

.dashboard-row, .mini-log-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.dashboard-patient, .mini-log-patient {
    font-weight: 600;
    color: #0f172a;
    text-align: left;
}

.dashboard-meta, .mini-log-meta {
    font-size: 0.75rem;
    color: #475569;
    text-align: left;
}

.dashboard-volume, .mini-log-volume {
    font-weight: 700;
    color: #1d4ed8;
}

.dashboard-badge, .mini-log-badge {
    background: rgba(28, 100, 242, 0.08);
    color: #1e40af;
    padding: 2px 7px;
    border-radius: 8px;
    font-size: 0.72rem;
    font-weight: 600;
    display: inline-block;
}

.dashboard-staff, .mini-log-staff {
    background: #e2e8f0;
    color: #334155;
    padding: 1px 5px;
    border-radius: 4px;
    font-size: 0.68rem;
    font-weight: 600;
    margin-left: 5px;
}

.dashboard-empty, .mini-log-empty {
    text-align: center;
    color: var(--text-secondary);
    padding: 15px 5px;
    font-style: italic;
    font-size: 0.85rem;
}
