/* MBL Foundation Medical ERP Design Stylesheet */

/* Imports */
@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700;800&family=Plus+Jakarta+Sans:wght@300;400;500;600;700;800&display=swap');

:root {
    /* Color Palette */
    --primary: #0d9488;          /* Emerald/Teal */
    --primary-dark: #0f766e;     /* Dark Teal */
    --primary-light: #f0fdf4;    /* Light Sage */
    --primary-border: #ccfbf1;   /* Pale Teal Border */
    --accent: #10b981;           /* Mint Green */
    --accent-light: #d1fae5;     /* Light Mint */
    --secondary: #64748b;        /* Cool Slate */
    --text-main: #1e293b;        /* Charcoal Dark */
    --text-muted: #64748b;       /* Cool Slate Text */
    --bg-app: #f8fafc;           /* Light Canvas */
    --bg-card: #ffffff;          /* Pure White */
    --border-color: #e2e8f0;     /* Light Grey border */
    
    /* Status Colors */
    --success: #16a34a;          /* Rich Green */
    --success-light: #dcfce7;
    --warning: #ea580c;          /* Orange */
    --warning-light: #ffedd5;
    --danger: #dc2626;           /* Red */
    --danger-light: #fee2e2;
    --info: #2563eb;             /* Blue */
    --info-light: #dbeafe;
    
    /* Layout Tokens */
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 20px;
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.05);
    --shadow-md: 0 4px 18px rgba(15, 118, 110, 0.04), 0 2px 6px rgba(0,0,0,0.03);
    --shadow-lg: 0 10px 30px rgba(15, 118, 110, 0.08), 0 4px 12px rgba(0,0,0,0.04);
    --transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    
    /* Fonts */
    --font-heading: 'Outfit', sans-serif;
    --font-body: 'Plus Jakarta Sans', sans-serif;
}

/* Base resets & styles */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: var(--font-body);
    background-color: var(--bg-app);
    color: var(--text-main);
    line-height: 1.6;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-heading);
    font-weight: 700;
    color: var(--text-main);
    line-height: 1.3;
}

/* Utilities */
.text-center { text-align: center; }
.text-right { text-align: right; }
.d-flex { display: flex; }
.align-center { align-items: center; }
.justify-between { justify-content: space-between; }
.flex-column { flex-direction: column; }
.gap-1 { gap: 0.5rem; }
.gap-2 { gap: 1rem; }
.gap-3 { gap: 1.5rem; }
.w-100 { width: 100%; }

.badge {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    gap: 0.25rem;
}
.badge-pending { background-color: var(--warning-light); color: var(--warning); border: 1px solid rgba(234,88,12,0.15); }
.badge-approved { background-color: var(--success-light); color: var(--success); border: 1px solid rgba(22,163,74,0.15); }
.badge-dispatched { background-color: var(--info-light); color: var(--info); border: 1px solid rgba(37,99,235,0.15); }
.badge-completed { background-color: var(--success-light); color: var(--success); border: 1px solid rgba(22,163,74,0.15); }
.badge-rejected { background-color: var(--danger-light); color: var(--danger); border: 1px solid rgba(220,38,38,0.15); }
.badge-low-stock { background-color: var(--danger-light); color: var(--danger); font-size: 0.7rem; animation: pulse 2s infinite; }

@keyframes pulse {
    0% { opacity: 1; }
    50% { opacity: 0.5; }
    100% { opacity: 1; }
}

/* Toast System */
.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-width: 400px;
    width: calc(100% - 40px);
}
.toast {
    background: var(--bg-card);
    border-left: 5px solid var(--primary);
    padding: 1rem 1.25rem;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    display: flex;
    align-items: flex-start;
    gap: 12px;
    transform: translateX(120%);
    transition: transform 0.35s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}
.toast.active { transform: translateX(0); }
.toast-icon { font-size: 1.25rem; }
.toast-success { border-left-color: var(--success); }
.toast-success .toast-icon { color: var(--success); }
.toast-danger { border-left-color: var(--danger); }
.toast-danger .toast-icon { color: var(--danger); }
.toast-warning { border-left-color: var(--warning); }
.toast-warning .toast-icon { color: var(--warning); }
.toast-info { border-left-color: var(--info); }
.toast-info .toast-icon { color: var(--info); }
.toast-content { flex: 1; }
.toast-title { font-weight: 700; font-size: 0.9rem; margin-bottom: 2px; }
.toast-message { font-size: 0.8rem; color: var(--text-muted); }

/* Announcement Ticker Bar */
.announcement-bar {
    background: linear-gradient(90deg, var(--primary-dark) 0%, #0d9488 100%);
    color: #ffffff;
    padding: 10px 0;
    font-size: 0.88rem;
    font-weight: 700;
    overflow: hidden;
    position: relative;
    white-space: nowrap;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    z-index: 101;
}

.announcement-track {
    display: inline-block;
    padding-left: 100%;
    animation: announcement-marquee 25s linear infinite;
}

.announcement-track:hover {
    animation-play-state: paused;
}

@keyframes announcement-marquee {
    0% { transform: translate3d(0, 0, 0); }
    100% { transform: translate3d(-100%, 0, 0); }
}

/* Header & Public Portal styling */
.header-public {
    background: var(--bg-card);
    border-bottom: 1px solid var(--border-color);
    padding: 1rem 2rem;
    box-shadow: var(--shadow-sm);
    position: sticky;
    top: 0;
    z-index: 100;
}
.logo-container {
    display: flex;
    align-items: center;
    gap: 12px;
}
.logo-img {
    height: 48px;
    object-fit: contain;
}
.brand-name {
    font-family: var(--font-heading);
    font-size: 1.4rem;
    font-weight: 800;
    color: var(--primary-dark);
    letter-spacing: -0.02em;
    line-height: 1.1;
}
.brand-sub {
    font-size: 0.75rem;
    color: var(--text-muted);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

/* Landing / Public Section */
.hero-section {
    max-width: 1200px;
    margin: 3rem auto 1.5rem;
    padding: 0 1.5rem;
    text-align: center;
}
.hero-badge {
    display: inline-block;
    padding: 6px 16px;
    background: var(--primary-light);
    border: 1px solid var(--primary-border);
    border-radius: 99px;
    color: var(--primary-dark);
    font-weight: 700;
    font-size: 0.85rem;
    margin-bottom: 1.5rem;
}
.hero-title {
    font-size: 2.8rem;
    font-weight: 800;
    color: var(--primary-dark);
    margin-bottom: 1rem;
    letter-spacing: -0.03em;
}
.hero-desc {
    max-width: 700px;
    margin: 0 auto 2.5rem;
    color: var(--text-muted);
    font-size: 1.1rem;
}

/* Portal Grid Layout */
.portal-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
    max-width: 1200px;
    margin: 2rem auto 4rem;
    padding: 0 1.5rem;
}
.portal-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 2rem;
    text-decoration: none;
    color: inherit;
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
    position: relative;
    overflow: hidden;
    cursor: pointer;
}
.portal-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: var(--primary);
    transform: scaleX(0);
    transform-origin: left;
    transition: var(--transition);
}
.portal-card:hover {
    transform: translateY(-6px);
    box-shadow: var(--shadow-lg);
    border-color: rgba(13, 148, 136, 0.2);
}
.portal-card:hover::before {
    transform: scaleX(1);
}
.portal-card.highlight {
    background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary) 100%);
    color: #ffffff;
    border: none;
}
.portal-card.highlight .portal-icon {
    background: rgba(255,255,255,0.15);
    color: #ffffff;
}
.portal-card.highlight .portal-title {
    color: #ffffff;
}
.portal-card.highlight .portal-desc {
    color: rgba(255,255,255,0.8);
}
.portal-card.highlight::before {
    background: var(--accent);
}
.portal-icon {
    width: 56px;
    height: 56px;
    border-radius: var(--radius-md);
    background: var(--primary-light);
    color: var(--primary-dark);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.6rem;
    margin-bottom: 1.25rem;
    transition: var(--transition);
}
.portal-card:hover .portal-icon {
    transform: scale(1.1) rotate(4deg);
}
.portal-title {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--text-main);
    margin-bottom: 0.5rem;
}
.portal-desc {
    font-size: 0.9rem;
    color: var(--text-muted);
}

/* Authentication Page */
.auth-container {
    max-width: 480px;
    margin: 4rem auto;
    padding: 0 1.5rem;
}
.auth-card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-lg);
    padding: 2.5rem;
    position: relative;
}
.auth-logo {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    margin-bottom: 2rem;
}
.auth-subtitle {
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--primary-dark);
    font-weight: 700;
}
.auth-title {
    font-size: 1.6rem;
    font-weight: 800;
    margin-bottom: 0.5rem;
}
.auth-desc {
    color: var(--text-muted);
    font-size: 0.9rem;
    text-align: center;
    margin-bottom: 1.5rem;
}
.form-group {
    margin-bottom: 1.25rem;
}
.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1.25rem;
    margin-bottom: 1.25rem;
}
.form-label {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 0.4rem;
    color: var(--text-main);
}
.form-label span {
    color: var(--danger);
}
.form-control {
    width: 100%;
    padding: 0.75rem 1rem;
    font-family: var(--font-body);
    font-size: 0.9rem;
    color: var(--text-main);
    background-color: var(--bg-app);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    transition: var(--transition);
    outline: none;
}
.form-control:focus {
    border-color: var(--primary);
    background-color: var(--bg-card);
    box-shadow: 0 0 0 3px rgba(13, 148, 136, 0.1);
}
select.form-control {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%2364748b'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 9l-7 7-7-7'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 16px;
    padding-right: 2.5rem;
}
.otp-container {
    display: none;
    margin-top: 1rem;
    animation: fadeIn 0.3s forwards;
}
.otp-inputs {
    display: flex;
    gap: 8px;
    justify-content: space-between;
    margin-bottom: 1rem;
}
.otp-digit {
    width: 50px;
    height: 50px;
    font-size: 1.5rem;
    text-align: center;
    font-weight: 700;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    background: var(--bg-app);
}
.otp-digit:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(13, 148, 136, 0.1);
    outline: none;
}
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.75rem 1.5rem;
    font-family: var(--font-body);
    font-size: 0.9rem;
    font-weight: 600;
    border-radius: var(--radius-md);
    border: 1px solid transparent;
    cursor: pointer;
    transition: var(--transition);
    gap: 8px;
    text-decoration: none;
}
.btn-primary {
    background-color: var(--primary);
    color: #ffffff;
}
.btn-primary:hover {
    background-color: var(--primary-dark);
    transform: translateY(-1px);
}
.btn-secondary {
    background-color: var(--bg-app);
    color: var(--text-main);
    border-color: var(--border-color);
}
.btn-secondary:hover {
    background-color: #f1f5f9;
}
.btn-outline {
    background-color: transparent;
    border-color: var(--primary);
    color: var(--primary);
}
.btn-outline:hover {
    background-color: var(--primary-light);
}
.btn-danger {
    background-color: var(--danger);
    color: #ffffff;
}
.btn-danger:hover {
    background-color: #b91c1c;
}
.btn-sm {
    padding: 0.4rem 0.8rem;
    font-size: 0.8rem;
    border-radius: var(--radius-sm);
}
.btn-link {
    background: none;
    border: none;
    color: var(--primary);
    cursor: pointer;
    font-weight: 600;
    font-size: 0.85rem;
}
.btn-link:hover {
    color: var(--primary-dark);
    text-decoration: underline;
}
.checkbox-group {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.85rem;
    cursor: pointer;
}
.checkbox-group input {
    width: 16px;
    height: 16px;
    accent-color: var(--primary);
}

.file-upload-wrapper {
    position: relative;
    border: 2px dashed var(--border-color);
    border-radius: var(--radius-md);
    padding: 1.5rem;
    text-align: center;
    background: var(--bg-app);
    cursor: pointer;
    transition: var(--transition);
}
.file-upload-wrapper:hover {
    border-color: var(--primary);
    background: var(--primary-light);
}
.file-upload-icon {
    font-size: 1.8rem;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
}
.file-upload-text {
    font-size: 0.8rem;
    color: var(--text-muted);
}
.file-upload-text span {
    color: var(--primary);
    font-weight: 600;
}
.file-upload-input {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
}
.upload-preview {
    margin-top: 8px;
    max-width: 100%;
    max-height: 80px;
    border-radius: var(--radius-sm);
    display: none;
    object-fit: cover;
}

/* Medical Store Registration Section */
.reg-container {
    max-width: 900px;
    margin: 3rem auto;
    padding: 0 1.5rem;
}
.reg-card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-lg);
    padding: 3rem;
}
.reg-header {
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 1.5rem;
    margin-bottom: 2rem;
}
.reg-title {
    font-size: 2rem;
    font-weight: 800;
    color: var(--primary-dark);
}
.reg-section-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--primary-dark);
    margin-top: 1.5rem;
    margin-bottom: 1rem;
    border-left: 4px solid var(--primary);
    padding-left: 8px;
}

/* System Dashboard Layout */
.dashboard-wrapper {
    display: flex;
    min-height: 100vh;
}

/* Sidebar Styling */
.sidebar {
    width: 260px;
    background: var(--primary-dark);
    color: #ffffff;
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    box-shadow: 2px 0 10px rgba(0,0,0,0.05);
    transition: var(--transition);
}
.sidebar-header {
    padding: 1.5rem;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    display: flex;
    align-items: center;
    gap: 10px;
}
.sidebar-logo {
    height: 36px;
    filter: brightness(0) invert(1);
}
.sidebar-title {
    font-family: var(--font-heading);
    font-size: 1.1rem;
    font-weight: 800;
    line-height: 1.1;
}
.sidebar-subtitle {
    font-size: 0.65rem;
    color: rgba(255,255,255,0.7);
    letter-spacing: 0.05em;
}
.sidebar-user {
    padding: 1.25rem 1.5rem;
    background: rgba(0,0,0,0.15);
    border-bottom: 1px solid rgba(255,255,255,0.05);
}
.sidebar-user-role {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--accent);
    font-weight: 800;
}
.sidebar-user-name {
    font-weight: 600;
    font-size: 0.95rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.sidebar-menu {
    list-style: none;
    padding: 1.5rem 0.75rem;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.sidebar-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 0.75rem 1rem;
    color: rgba(255,255,255,0.8);
    text-decoration: none;
    border-radius: var(--radius-md);
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
}
.sidebar-link:hover, .sidebar-link.active {
    background: rgba(255,255,255,0.1);
    color: #ffffff;
}
.sidebar-link.active {
    background: var(--accent);
    font-weight: 700;
}
.sidebar-footer {
    padding: 1.25rem;
    border-top: 1px solid rgba(255,255,255,0.1);
}

/* Main Content Area */
.main-layout {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
}
.main-header {
    background: var(--bg-card);
    border-bottom: 1px solid var(--border-color);
    padding: 1rem 2rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 70px;
}
.header-actions {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}
.notification-bell {
    position: relative;
    cursor: pointer;
    font-size: 1.2rem;
    color: var(--text-muted);
}
.notification-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    width: 15px;
    height: 15px;
    background: var(--danger);
    border-radius: 50%;
    color: white;
    font-size: 0.6rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
}
.content-body {
    padding: 2rem;
    flex: 1;
    overflow-y: auto;
}

/* Stats Cards Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}
.stat-card {
    background: var(--bg-card);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
    padding: 1.5rem;
    box-shadow: var(--shadow-sm);
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.stat-info {
    display: flex;
    flex-direction: column;
}
.stat-label {
    font-size: 0.8rem;
    color: var(--text-muted);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 4px;
}
.stat-val {
    font-size: 1.8rem;
    font-weight: 800;
    color: var(--text-main);
    line-height: 1.2;
}
.stat-icon-wrap {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
}
.stat-teal { background: var(--primary-light); color: var(--primary); }
.stat-green { background: var(--accent-light); color: var(--success); }
.stat-blue { background: var(--info-light); color: var(--info); }
.stat-orange { background: var(--warning-light); color: var(--warning); }
.stat-red { background: var(--danger-light); color: var(--danger); }

/* Dashboard Content Grid */
.dashboard-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 1.5rem;
    margin-bottom: 2rem;
}
@media (max-width: 1024px) {
    .dashboard-grid {
        grid-template-columns: 1fr;
    }
}
.card {
    background: var(--bg-card);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
    margin-bottom: 1.5rem;
    overflow: hidden;
}
.card-header {
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.card-title {
    font-size: 1.1rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 8px;
}
.card-body {
    padding: 1.5rem;
}
.card-footer {
    padding: 1rem 1.5rem;
    background: var(--bg-app);
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: flex-end;
}

/* Tables styling */
.table-responsive {
    overflow-x: auto;
    width: 100%;
}
.table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
    text-align: left;
}
.table th {
    background-color: var(--bg-app);
    font-weight: 700;
    padding: 0.85rem 1rem;
    color: var(--text-muted);
    border-bottom: 2px solid var(--border-color);
    white-space: nowrap;
}
.table td {
    padding: 0.85rem 1rem;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-main);
    vertical-align: middle;
}
.table tr:hover {
    background-color: rgba(13, 148, 136, 0.02);
}

/* Modals styling */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 23, 42, 0.5);
    backdrop-filter: blur(4px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 1rem;
}
.modal-overlay.active {
    display: flex;
    animation: fadeIn 0.25s forwards;
}
.modal {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-lg);
    max-width: 600px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    animation: slideUp 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}
.modal.modal-lg {
    max-width: 900px;
}
.modal-header {
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.modal-close {
    background: none;
    border: none;
    font-size: 1.25rem;
    cursor: pointer;
    color: var(--text-muted);
    transition: var(--transition);
}
.modal-close:hover {
    color: var(--danger);
    transform: rotate(90deg);
}
.modal-body {
    padding: 1.5rem;
    overflow-y: auto;
}
.modal-footer {
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: flex-end;
    gap: 12px;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}
@keyframes slideUp {
    from { transform: translateY(20px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

/* Order selection lists */
.medicine-select-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
    max-height: 250px;
    overflow-y: auto;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 8px;
    margin-bottom: 1rem;
}
.medicine-select-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 12px;
    border-bottom: 1px solid var(--border-color);
}
.medicine-select-row:last-child {
    border-bottom: none;
}
.medicine-qty-input {
    width: 80px;
    padding: 4px 8px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    text-align: center;
}

/* Billing Screen Cart styles */
.billing-layout {
    display: grid;
    grid-template-columns: 1.2fr 0.8fr;
    gap: 1.5rem;
}
@media (max-width: 900px) {
    .billing-layout {
        grid-template-columns: 1fr;
    }
}
.medicine-search-item {
    padding: 10px 15px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
}
.medicine-search-item:hover {
    background-color: var(--primary-light);
}

.cart-item-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid var(--border-color);
}
.cart-summary {
    background: var(--bg-app);
    padding: 1.25rem;
    border-radius: var(--radius-md);
    margin-top: 1rem;
}
.summary-line {
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
    font-size: 0.9rem;
}
.summary-line.highlight {
    font-size: 1.1rem;
    font-weight: 800;
    color: var(--primary-dark);
    border-top: 1px dashed var(--border-color);
    padding-top: 8px;
}

/* Printable Invoice Design */
.invoice-print-container {
    background: white;
    color: #000000;
    padding: 2rem;
    font-family: 'Outfit', sans-serif;
    max-width: 800px;
    margin: 0 auto;
    border: 1px solid #ddd;
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-sm);
}
.invoice-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    border-bottom: 3px double var(--primary-dark);
    padding-bottom: 1.5rem;
    margin-bottom: 1.5rem;
}
.invoice-branding {
    display: flex;
    align-items: center;
    gap: 14px;
}
.invoice-logo {
    height: 60px;
}
.invoice-title-block h1 {
    font-size: 1.8rem;
    color: var(--primary-dark);
    letter-spacing: -0.01em;
}
.invoice-title-block p {
    font-size: 0.8rem;
    color: var(--text-muted);
}
.invoice-meta-info {
    text-align: right;
    font-size: 0.85rem;
}
.invoice-subtitle-banner {
    background-color: var(--primary-light);
    color: var(--primary-dark);
    text-align: center;
    font-weight: 800;
    font-size: 0.95rem;
    padding: 8px;
    border-radius: var(--radius-sm);
    margin-bottom: 1.5rem;
    border: 1px solid var(--primary-border);
}
.invoice-details-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    margin-bottom: 1.5rem;
    font-size: 0.85rem;
}
.invoice-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 1.5rem;
    font-size: 0.85rem;
}
.invoice-table th {
    background-color: #f3f4f6;
    border: 1px solid #d1d5db;
    padding: 6px 10px;
    font-weight: 700;
}
.invoice-table td {
    border: 1px solid #e5e7eb;
    padding: 6px 10px;
}
.invoice-totals-wrapper {
    display: grid;
    grid-template-columns: 1.2fr 0.8fr;
    gap: 1.5rem;
    margin-bottom: 2rem;
}
.invoice-footer {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    margin-top: 3rem;
    border-top: 1px solid #e5e7eb;
    padding-top: 1.5rem;
    font-size: 0.8rem;
}
.invoice-qrcode {
    width: 80px;
    height: 80px;
}

/* Charts / Dashboard visuals */
.bar-chart-container {
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.bar-chart-row {
    display: grid;
    grid-template-columns: 100px 1fr 60px;
    align-items: center;
    gap: 10px;
    font-size: 0.85rem;
}
.bar-chart-track {
    background: var(--bg-app);
    height: 16px;
    border-radius: 99px;
    overflow: hidden;
}
.bar-chart-fill {
    background: var(--primary);
    height: 100%;
    border-radius: 99px;
    transition: width 1s ease-in-out;
}

/* Alerts and Log History Panel */
.audit-logs-list {
    max-height: 350px;
    overflow-y: auto;
    font-size: 0.8rem;
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.audit-log-item {
    padding: 8px 12px;
    border-radius: var(--radius-sm);
    background: var(--bg-app);
    border-left: 3px solid var(--secondary);
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.audit-log-item.success { border-left-color: var(--success); }
.audit-log-item.warning { border-left-color: var(--warning); }
.audit-log-item.danger { border-left-color: var(--danger); }
.audit-log-item.info { border-left-color: var(--info); }

/* Document checklist inside registration detail */
.doc-check-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}
.doc-check-card {
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 10px;
    text-align: center;
    background: var(--bg-app);
}
.doc-check-img {
    width: 100%;
    height: 120px;
    object-fit: cover;
    border-radius: var(--radius-sm);
    margin-bottom: 8px;
    border: 1px solid var(--border-color);
    cursor: pointer;
}

/* System Notifications Tray */
.notify-center-tray {
    position: fixed;
    bottom: 20px;
    left: 20px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-lg);
    border-radius: var(--radius-md);
    width: 320px;
    max-height: 250px;
    overflow-y: auto;
    z-index: 999;
    display: none;
    flex-direction: column;
}
.notify-center-header {
    background: var(--primary-dark);
    color: white;
    padding: 8px 12px;
    font-size: 0.85rem;
    font-weight: 700;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.notify-center-item {
    padding: 8px 12px;
    font-size: 0.75rem;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.notify-center-item:last-child {
    border-bottom: none;
}
.notify-meta {
    font-weight: 700;
    color: var(--primary-dark);
    display: flex;
    justify-content: space-between;
}

/* Print Overrides */
@media print {
    body {
        background: #ffffff !important;
        color: #000000 !important;
        font-size: 12pt;
    }
    
    .no-print {
        display: none !important;
    }
    
    /* Hide all elements that are not part of the invoice or report printing */
    .dashboard-wrapper, .toast-container, .header-public, .hero-section, .portal-grid, .auth-container, .reg-container, .notify-center-tray {
        display: none !important;
    }
    
    /* Hide modal overlays except the one marked for active printing */
    .modal-overlay {
        display: none !important;
    }
    
    .modal-overlay.active-print-overlay {
        display: block !important;
        position: absolute !important;
        top: 0 !important;
        left: 0 !important;
        width: 100% !important;
        height: auto !important;
        background: none !important;
        backdrop-filter: none !important;
        padding: 0 !important;
        margin: 0 !important;
        box-shadow: none !important;
    }
    
    .modal-overlay.active-print-overlay .modal {
        box-shadow: none !important;
        border: none !important;
        max-width: 100% !important;
        width: 100% !important;
        height: auto !important;
        max-height: none !important;
        overflow: visible !important;
        padding: 0 !important;
        margin: 0 !important;
    }
    
    .modal-overlay.active-print-overlay .modal-header,
    .modal-overlay.active-print-overlay .modal-footer {
        display: none !important;
    }
    
    /* Make the printed element visible and force standard layout */
    .printable-area-active {
        display: block !important;
        position: absolute;
        top: 0;
        left: 0;
        width: 100%;
        margin: 0;
        padding: 0;
        box-shadow: none !important;
        border: none !important;
    }
    
    /* Format printable invoice */
    .invoice-print-container {
        width: 100% !important;
        max-width: 100% !important;
        border: none !important;
        padding: 0 !important;
        margin: 0 !important;
        box-shadow: none !important;
    }
    
    .invoice-header {
        border-bottom: 3px double #000 !important;
    }
    
    .invoice-subtitle-banner {
        background-color: #f3f4f6 !important;
        color: #000000 !important;
        border: 1px solid #000000 !important;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }
    
    .invoice-table th {
        background-color: #f3f4f6 !important;
        border: 1px solid #000 !important;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }
    
    .invoice-table td {
        border: 1px solid #000 !important;
    }
    
    .btn, button, .modal-close {
        display: none !important;
    }
}
