/* Central Medical Pharmacy Compliance Platform — Design System */
@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700;800&family=Plus+Jakarta+Sans:wght@400;500;600;700;800&display=swap');

:root {
    --primary: #0284c7;
    --primary-dark: #0369a1;
    --primary-light: #e0f2fe;
    --secondary: #0f172a;
    --accent: #10b981;
    --accent-dark: #059669;
    --warning: #f59e0b;
    --danger: #ef4444;
    --danger-light: #fee2e2;
    --bg-main: #f8fafc;
    --bg-card: #ffffff;
    --border-color: #e2e8f0;
    --text-main: #1e293b;
    --text-muted: #64748b;
    --font-heading: 'Outfit', sans-serif;
    --font-body: 'Plus Jakarta Sans', sans-serif;
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.08), 0 2px 4px -2px rgb(0 0 0 / 0.05);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.05);
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;
}

body {
    font-family: var(--font-body);
    background-color: var(--bg-main);
    color: var(--text-main);
    line-height: 1.6;
    margin: 0;
    padding: 0;
    -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-heading);
    font-weight: 700;
    color: var(--secondary);
    letter-spacing: -0.02em;
}

a {
    color: var(--primary);
    text-decoration: none;
    transition: all 0.2s ease;
}

a:hover {
    color: var(--primary-dark);
}

/* Layout Architecture */
.app-wrapper {
    display: flex;
    min-height: 100vh;
}

/* Sidebar Backdrop for Mobile */
.sidebar-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(15, 23, 42, 0.65);
    backdrop-filter: blur(3px);
    -webkit-backdrop-filter: blur(3px);
    z-index: 1040;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.25s ease, visibility 0.25s ease;
}

.sidebar-backdrop.show {
    opacity: 1;
    visibility: visible;
}

/* Sidebar Toggle & Close Buttons */
.sidebar-toggle-btn,
.sidebar-close-btn {
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: #94a3b8;
    width: 32px;
    height: 32px;
    border-radius: 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.sidebar-toggle-btn:hover,
.sidebar-close-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    color: #ffffff;
}

.sidebar-toggle-btn i {
    display: inline-block;
    transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.sidebar {
    width: 270px;
    background: linear-gradient(180deg, #0f172a 0%, #1e293b 100%);
    color: #f1f5f9;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    border-right: 1px solid rgba(255, 255, 255, 0.05);
    box-shadow: var(--shadow-lg);
    z-index: 100;
    transition: width 0.25s cubic-bezier(0.4, 0, 0.2, 1), transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.sidebar-header {
    padding: 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    display: flex;
    align-items: center;
    gap: 12px;
}

.sidebar-brand {
    font-family: var(--font-heading);
    font-size: 1.15rem;
    font-weight: 700;
    color: #fff;
    line-height: 1.2;
    white-space: nowrap;
}

.sidebar-brand small {
    display: block;
    font-size: 0.75rem;
    color: #38bdf8;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.sidebar-menu {
    list-style: none;
    padding: 16px 12px;
    margin: 0;
    flex-grow: 1;
}

.sidebar-menu li {
    margin-bottom: 4px;
}

.sidebar-menu a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    color: #94a3b8;
    border-radius: var(--radius-sm);
    font-weight: 500;
    font-size: 0.92rem;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.sidebar-menu a:hover,
.sidebar-menu a.active {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.1);
    box-shadow: 0 2px 4px rgba(0,0,0,0.15);
}

.sidebar-menu a.active {
    background: linear-gradient(90deg, #0284c7 0%, #0369a1 100%);
    color: #fff;
    font-weight: 600;
}

.sidebar-menu a i {
    width: 20px;
    text-align: center;
    font-size: 1.05rem;
    flex-shrink: 0;
}

.sidebar-footer {
    padding: 16px 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    font-size: 0.82rem;
    color: #64748b;
    white-space: nowrap;
}

/* Desktop Collapsed Sidebar */
@media (min-width: 992px) {
    .sidebar-collapsed .sidebar,
    .sidebar.collapsed {
        width: 78px;
    }

    .sidebar-collapsed .sidebar .sidebar-brand,
    .sidebar.collapsed .sidebar-brand,
    .sidebar-collapsed .sidebar .sidebar-footer,
    .sidebar.collapsed .sidebar-footer,
    .sidebar-collapsed .sidebar .nav-text,
    .sidebar.collapsed .nav-text,
    .sidebar-collapsed .sidebar .ms-auto,
    .sidebar.collapsed .ms-auto {
        display: none !important;
    }

    .sidebar-collapsed .sidebar-header,
    .sidebar.collapsed .sidebar-header {
        padding: 16px 8px;
        flex-direction: column;
        gap: 10px;
        justify-content: center !important;
        align-items: center !important;
    }

    .sidebar-collapsed #sidebarCollapseBtn,
    .sidebar.collapsed #sidebarCollapseBtn {
        display: inline-flex !important;
        margin: 0 auto;
    }

    .sidebar-collapsed #sidebarCollapseBtn i,
    .sidebar.collapsed #sidebarCollapseBtn i {
        transform: rotate(180deg);
    }

    .sidebar-collapsed .sidebar-menu,
    .sidebar.collapsed .sidebar-menu {
        padding: 16px 8px;
    }

    .sidebar-collapsed .sidebar-menu a,
    .sidebar.collapsed .sidebar-menu a {
        justify-content: center;
        padding: 14px 10px;
        gap: 0;
    }

    .sidebar-collapsed .sidebar-menu a i,
    .sidebar.collapsed .sidebar-menu a i {
        margin: 0;
        font-size: 1.25rem;
    }
}

/* Mobile Responsive Sidebar Drawer (< 992px) */
@media (max-width: 991.98px) {
    .sidebar {
        position: fixed;
        top: 0;
        left: 0;
        bottom: 0;
        height: 100vh;
        width: 280px;
        max-width: 85vw;
        z-index: 1050;
        transform: translateX(-100%);
        overflow-y: auto;
    }

    .sidebar.show {
        transform: translateX(0);
        box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    }

    .main-content {
        width: 100%;
        min-width: 0;
    }

    .top-navbar {
        padding: 10px 14px;
        gap: 8px;
    }

    .content-body {
        padding: 16px 12px;
    }

    .stat-card {
        padding: 16px;
    }

    .card-header {
        padding: 14px 16px !important;
    }

    .card-body {
        padding: 16px !important;
    }
}

.main-content {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
}

.top-navbar {
    background: #ffffff;
    border-bottom: 1px solid var(--border-color);
    padding: 14px 28px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: var(--shadow-sm);
}

.content-body {
    padding: 30px;
    flex-grow: 1;
}

/* Metric / Stat Cards */
.stat-card {
    background: #ffffff;
    border-radius: var(--radius-md);
    padding: 24px;
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    position: relative;
    overflow: hidden;
}

.stat-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-md);
}

.stat-icon {
    width: 52px;
    height: 52px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
}

.stat-val {
    font-size: 2rem;
    font-weight: 800;
    color: var(--secondary);
    line-height: 1.1;
    margin-top: 8px;
    font-family: var(--font-heading);
}

.stat-label {
    font-size: 0.85rem;
    color: var(--text-muted);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

/* Glass & Premium Cards */
.card {
    background: #ffffff;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
    margin-bottom: 24px;
}

.card-header {
    background: #ffffff;
    border-bottom: 1px solid var(--border-color);
    padding: 18px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 10px;
    border-top-left-radius: var(--radius-md);
    border-top-right-radius: var(--radius-md);
}

.card-header.d-block {
    display: block !important;
}

.card-header h5 {
    margin: 0;
    font-size: 1.15rem;
    font-weight: 700;
}

.card-body {
    padding: 24px;
}

/* Tables */
.table-custom {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
}

.table-custom th {
    background: #f8fafc;
    color: #475569;
    font-weight: 700;
    font-size: 0.82rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 14px 18px;
    border-bottom: 2px solid var(--border-color);
}

.table-custom td {
    padding: 14px 18px;
    border-bottom: 1px solid var(--border-color);
    font-size: 0.92rem;
    vertical-align: middle;
}

.table-custom tr:last-child td {
    border-bottom: none;
}

.table-custom tbody tr:hover td {
    background-color: #f1f5f9;
}

/* Badges */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 6px 12px;
    border-radius: 9999px;
    font-size: 0.8rem;
    font-weight: 600;
}

.badge-success {
    background: #dcfce7;
    color: #15803d;
}

.badge-warning {
    background: #fef3c7;
    color: #b45309;
}

.badge-danger {
    background: #fee2e2;
    color: #b91c1c;
}

.badge-info {
    background: #e0f2fe;
    color: #0369a1;
}

.badge-secondary {
    background: #f1f5f9;
    color: #475569;
}

/* Forms & Inputs */
.form-label {
    font-weight: 600;
    font-size: 0.82rem;
    color: #334155;
    margin-bottom: 5px;
}

.form-control, .form-select {
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 8px 12px;
    font-size: 0.875rem;
    color: var(--text-main);
    transition: all 0.2s ease;
    width: 100%;
    box-sizing: border-box;
}

.form-control:focus, .form-select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(2, 132, 199, 0.15);
    outline: none;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-weight: 600;
    padding: 10px 20px;
    border-radius: var(--radius-sm);
    border: 1px solid transparent;
    cursor: pointer;
    font-size: 0.92rem;
    transition: all 0.2s ease;
}

.btn-primary {
    background: var(--primary);
    color: #ffffff;
    box-shadow: 0 2px 4px rgba(2, 132, 199, 0.25);
}

.btn-primary:hover {
    background: var(--primary-dark);
    color: #ffffff;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(2, 132, 199, 0.35);
}

.btn-success {
    background: var(--accent);
    color: #ffffff;
}

.btn-success:hover {
    background: var(--accent-dark);
    color: #ffffff;
}

.btn-outline-primary {
    border-color: var(--primary);
    color: var(--primary);
    background: transparent;
}

.btn-outline-primary:hover {
    background: var(--primary);
    color: #ffffff;
}

.btn-sm {
    padding: 6px 12px;
    font-size: 0.82rem;
}

/* Public & Print Posters Styling */
.poster-container {
    max-width: 800px;
    margin: 0 auto;
    background: #fff;
    border: 2px solid #0284c7;
    border-radius: 16px;
    padding: 36px;
    box-shadow: 0 10px 25px -5px rgba(0,0,0,0.1);
    position: relative;
    box-sizing: border-box;
}

.poster-notice-badge {
    background: #0284c7;
    color: #ffffff;
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    padding: 6px 16px;
    border-radius: 50rem;
    display: inline-block;
    max-width: 100%;
    white-space: normal;
    text-align: center;
    line-height: 1.35;
    box-shadow: 0 2px 4px rgba(2, 132, 199, 0.25);
    word-break: break-word;
}

.poster-header {
    text-align: center;
    border-bottom: 2px solid #0284c7;
    padding-bottom: 20px;
    margin-bottom: 24px;
}

.poster-header h1 {
    font-size: clamp(1.4rem, 4.5vw, 2.2rem);
    color: #0369a1;
    margin: 0 0 6px 0;
    text-transform: uppercase;
    word-break: break-word;
    line-height: 1.25;
}

.poster-qr-column {
    border-right: 1px solid #e2e8f0;
}

@media (max-width: 767.98px) {
    .poster-container {
        padding: 20px 14px;
        border-radius: 12px;
    }
    .poster-notice-badge {
        font-size: 0.72rem;
        padding: 5px 10px;
        letter-spacing: 0.04em;
    }
    .poster-header {
        padding-bottom: 16px;
        margin-bottom: 18px;
    }
    .poster-qr-column {
        border-right: none;
        border-bottom: 1px solid #e2e8f0;
        padding-bottom: 1.5rem;
        margin-bottom: 1.5rem;
    }
}

@media print {
    body {
        background: #fff;
        padding: 0;
    }
    .sidebar, .top-navbar, .no-print {
        display: none !important;
    }
    .poster-container {
        border: 2px solid #000;
        box-shadow: none;
        padding: 20px;
        width: 100%;
        max-width: 100%;
    }
}

/* ==========================================================================
   Central Pharmacy SaaS Onboarding & Authentication Design System
   ========================================================================== */
.onboarding-body {
    background-color: #f8fafc;
    background-image: radial-gradient(at 0% 0%, rgba(5, 150, 105, 0.05) 0px, transparent 50%),
                      radial-gradient(at 100% 100%, rgba(37, 99, 235, 0.05) 0px, transparent 50%);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 30px 15px;
    margin: 0;
}

.onboarding-card {
    background: #ffffff;
    border-radius: 20px;
    box-shadow: 0 20px 40px -10px rgba(0, 0, 0, 0.07), 0 1px 3px 0 rgba(0, 0, 0, 0.04);
    border: 1px solid #eef2f6;
    width: 100%;
    max-width: 450px;
    padding: 36px 32px;
    margin: 0 auto;
    position: relative;
}

.onboarding-logo-badge {
    width: 52px;
    height: 52px;
    border-radius: 14px;
    background: linear-gradient(135deg, #ecfdf5 0%, #f0fdf4 100%);
    border: 1px solid #d1fae5;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 16px;
    box-shadow: 0 4px 10px rgba(5, 150, 105, 0.08);
}

.onboarding-title {
    font-size: 1.6rem;
    font-weight: 800;
    color: #0284c7;
    background: linear-gradient(135deg, #059669 0%, #0284c7 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 6px;
    letter-spacing: -0.03em;
}

.onboarding-subtitle {
    font-size: 0.92rem;
    color: #64748b;
    margin-bottom: 24px;
}

.auth-form-group {
    margin-bottom: 18px;
}

.auth-form-label {
    font-size: 0.88rem;
    font-weight: 600;
    color: #334155;
    margin-bottom: 6px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.auth-input-container {
    display: flex;
    align-items: center;
    background: #ffffff;
    border: 1.5px solid #e2e8f0;
    border-radius: 12px;
    transition: all 0.2s ease;
    overflow: hidden;
}

.auth-input-container:focus-within {
    border-color: #059669;
    box-shadow: 0 0 0 3.5px rgba(5, 150, 105, 0.12);
}

.auth-input-container .input-icon {
    padding-left: 14px;
    color: #94a3b8;
    font-size: 1rem;
}

.auth-input-container .form-control {
    border: none;
    box-shadow: none;
    padding: 12px 14px;
    font-size: 0.95rem;
    color: #1e293b;
    background: transparent;
    width: 100%;
}

.auth-input-container .form-control:focus {
    outline: none;
    box-shadow: none;
}

.auth-input-container .form-control::placeholder {
    color: #94a3b8;
}

.btn-gradient-cta {
    background: linear-gradient(135deg, #059669 0%, #2563eb 100%);
    color: #ffffff;
    font-weight: 700;
    font-size: 1rem;
    padding: 13px 20px;
    border-radius: 12px;
    border: none;
    width: 100%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    box-shadow: 0 8px 18px -4px rgba(5, 150, 105, 0.35);
    transition: all 0.25s ease;
    text-decoration: none;
    cursor: pointer;
}

.btn-gradient-cta:hover {
    color: #ffffff;
    transform: translateY(-2px);
    box-shadow: 0 12px 24px -4px rgba(37, 99, 235, 0.45);
    filter: brightness(1.04);
}

.btn-gradient-cta:active {
    transform: translateY(0);
}

.check-success-badge {
    width: 68px;
    height: 68px;
    border-radius: 50%;
    background: #ecfdf5;
    border: 2px solid #a7f3d0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #059669;
    font-size: 1.8rem;
    margin-bottom: 18px;
    box-shadow: 0 8px 20px rgba(5, 150, 105, 0.15);
}

.subdomain-display-card {
    background: #f0fdf9;
    border: 1.5px dashed #0d9488;
    color: #0f766e;
    font-weight: 700;
    font-size: 1.15rem;
    padding: 14px 20px;
    border-radius: 12px;
    text-align: center;
    margin-bottom: 20px;
    letter-spacing: 0.02em;
    word-break: break-all;
}

.support-footer-box {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    padding: 14px 18px;
    text-align: center;
    font-size: 0.85rem;
    color: #475569;
    margin-top: 24px;
}

.support-footer-box a {
    color: #059669;
    font-weight: 600;
}

.support-footer-box a:hover {
    color: #047857;
    text-decoration: underline;
}

.password-toggle-btn {
    background: transparent;
    border: none;
    color: #64748b;
    padding: 0 14px;
    cursor: pointer;
    font-size: 1rem;
    display: flex;
    align-items: center;
}

.password-toggle-btn:hover {
    color: #1e293b;
}

.sehat-navbar {
    background: #ffffff;
    border-bottom: 1px solid #e2e8f0;
    padding: 14px 0;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.03);
}

.sehat-nav-link {
    font-size: 0.92rem;
    font-weight: 600;
    color: #475569;
    padding: 8px 14px;
    border-radius: 8px;
    transition: all 0.2s;
    text-decoration: none;
}

.sehat-nav-link:hover {
    color: #059669;
    background: #f0fdf4;
}

.sehat-badge-active {
    background: #ef4444;
    color: #fff;
    font-size: 0.72rem;
    font-weight: 700;
    padding: 2px 7px;
    border-radius: 999px;
    margin-left: 4px;
}

