/* DocPulse Multi-Clinic Practice System - Premium UI Stylesheet */
@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@400;500;600;700&family=Plus+Jakarta+Sans:wght@400;500;600;700&display=swap');

:root {
    --primary: #0d9488;
    --primary-hover: #0f766e;
    --primary-light: #ccfbf1;
    --primary-dark: #134e4a;
    --secondary: #4f46e5;
    --secondary-hover: #4338ca;
    --secondary-light: #e0e7ff;
    --accent: #06b6d4;
    --success: #10b981;
    --success-light: #d1fae5;
    --warning: #f59e0b;
    --warning-light: #fef3c7;
    --danger: #ef4444;
    --danger-light: #fee2e2;
    --dark: #0f172a;
    --slate: #1e293b;
    --muted: #64748b;
    --light-bg: #f8fafc;
    --card-bg: #ffffff;
    --border-color: #e2e8f0;
    --sidebar-width: 260px;
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 20px;
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.07), 0 2px 4px -2px rgba(0, 0, 0, 0.05);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.08), 0 4px 6px -4px rgba(0, 0, 0, 0.03);
    --shadow-hover: 0 20px 25px -5px rgba(13, 148, 136, 0.12), 0 8px 10px -6px rgba(13, 148, 136, 0.08);
}

body {
    font-family: 'Plus Jakarta Sans', sans-serif;
    background-color: var(--light-bg);
    color: var(--dark);
    margin: 0;
    padding: 0;
    overflow-x: hidden;
}

h1, h2, h3, h4, h5, h6, .brand-font {
    font-family: 'Outfit', sans-serif;
    font-weight: 600;
    letter-spacing: -0.02em;
}

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

/* Sidebar Styling */
.app-sidebar {
    width: var(--sidebar-width);
    background: #0f172a;
    color: #f1f5f9;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    z-index: 1040;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 4px 0 15px rgba(0, 0, 0, 0.06);
}

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

.sidebar-brand-icon {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-md);
    background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 1.25rem;
    box-shadow: 0 4px 12px rgba(13, 148, 136, 0.4);
}

.sidebar-clinic-badge {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: var(--radius-md);
    padding: 0.75rem 1rem;
    margin: 1rem 1.25rem 0.5rem;
}

.sidebar-nav {
    padding: 1rem 0.75rem;
    flex-grow: 1;
    overflow-y: auto;
}

.nav-section-title {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #94a3b8;
    padding: 0.75rem 0.75rem 0.35rem;
    font-weight: 700;
}

.sidebar-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 0.75rem 0.85rem;
    color: #cbd5e1;
    text-decoration: none;
    border-radius: var(--radius-md);
    font-weight: 500;
    font-size: 0.925rem;
    margin-bottom: 4px;
    transition: all 0.2s ease;
}

.sidebar-link i {
    font-size: 1.15rem;
    color: #94a3b8;
    transition: all 0.2s ease;
}

.sidebar-link:hover {
    background: rgba(255, 255, 255, 0.08);
    color: #ffffff;
    transform: translateX(3px);
}

.sidebar-link:hover i {
    color: var(--primary-light);
}

.sidebar-link.active {
    background: linear-gradient(90deg, rgba(13, 148, 136, 0.25) 0%, rgba(13, 148, 136, 0.08) 100%);
    color: #ffffff;
    font-weight: 600;
    border-left: 3px solid var(--primary);
}

.sidebar-link.active i {
    color: var(--accent);
}

.sidebar-footer {
    padding: 1rem 1.25rem;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(0, 0, 0, 0.2);
}

/* Main Content Area */
.app-main {
    margin-left: var(--sidebar-width);
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    width: calc(100% - var(--sidebar-width));
    max-width: calc(100% - var(--sidebar-width));
}

/* Top Navbar */
.app-navbar {
    background: #ffffff;
    border-bottom: 1px solid var(--border-color);
    padding: 0.85rem 1.75rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 1030;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.03);
}

.page-container {
    padding: 1rem 1.25rem 2.5rem;
    flex-grow: 1;
    width: 100%;
    max-width: 100%;
}

/* Premium KPI Stat Cards */
.stat-card {
    background: #ffffff;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
    padding: 1.5rem;
    box-shadow: var(--shadow-sm);
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.stat-card::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--stat-border, var(--primary));
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}

.stat-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-hover);
    border-color: rgba(13, 148, 136, 0.3);
}

.stat-icon {
    width: 52px;
    height: 52px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    flex-shrink: 0;
}

.stat-icon.primary { background: #ccfbf1; color: #0f766e; }
.stat-icon.secondary { background: #e0e7ff; color: #4338ca; }
.stat-icon.success { background: #d1fae5; color: #047857; }
.stat-icon.warning { background: #fef3c7; color: #b45309; }
.stat-icon.danger { background: #fee2e2; color: #b91c1c; }
.stat-icon.dark { background: #f1f5f9; color: #0f172a; }

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

.stat-value {
    font-size: 1.85rem;
    font-weight: 700;
    line-height: 1.2;
    color: var(--dark);
    font-family: 'Outfit', sans-serif;
}

/* Custom Table Card */
.content-card {
    background: #ffffff;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
    /* Allow dropdown menus and floating action popups to display gracefully */
    margin-bottom: 1.75rem;
}

.content-card-header {
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--border-color);
    border-top-left-radius: var(--radius-lg);
    border-top-right-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: #ffffff;
}

/* Table container styling to ensure dropdown menus have ample clearance and never clip */
.table-responsive-dropdown {
    min-height: 260px;
    padding-bottom: 60px;
}

.table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.table-custom {
    margin-bottom: 0;
    width: 100%;
    table-layout: auto;
}

.table-custom th {
    background-color: #f8fafc;
    color: #475569;
    font-weight: 600;
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    padding: 0.55rem 0.55rem;
    border-bottom: 1px solid var(--border-color);
    white-space: nowrap;
}

.table-custom td {
    padding: 0.55rem 0.55rem;
    vertical-align: middle;
    color: #334155;
    border-bottom: 1px solid #f1f5f9;
    font-size: 0.815rem;
}

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

.btn-xs {
    padding: 0.2rem 0.45rem;
    font-size: 0.72rem;
    border-radius: var(--radius-sm);
    line-height: 1.2;
}

/* Commission Split Tag */
.split-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border-radius: 9999px;
    font-size: 0.775rem;
    font-weight: 600;
}

.split-badge.clinic {
    background: #f0fdf4;
    color: #166534;
    border: 1px solid #bbf7d0;
}

.split-badge.doctor {
    background: #eff6ff;
    color: #1e40af;
    border: 1px solid #bfdbfe;
}

/* Quick Slot Chips */
.slot-chip {
    padding: 8px 14px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
    background: #ffffff;
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    user-select: none;
}

.slot-chip:hover {
    border-color: var(--primary);
    background: var(--primary-light);
    color: var(--primary-dark);
}

.slot-chip.selected {
    background: var(--primary);
    color: #ffffff;
    border-color: var(--primary);
    box-shadow: 0 4px 10px rgba(13, 148, 136, 0.35);
}

.slot-chip.booked {
    background: #f1f5f9;
    color: #94a3b8;
    border-color: #e2e8f0;
    cursor: not-allowed;
    text-decoration: line-through;
}

/* Interactive Buttons */
.btn-primary {
    background-color: var(--primary);
    border-color: var(--primary);
    color: #ffffff;
    font-weight: 600;
    padding: 0.6rem 1.25rem;
    border-radius: var(--radius-md);
    box-shadow: 0 2px 4px rgba(13, 148, 136, 0.2);
    transition: all 0.2s ease;
}

.btn-primary:hover, .btn-primary:focus {
    background-color: var(--primary-hover);
    border-color: var(--primary-hover);
    box-shadow: 0 4px 12px rgba(13, 148, 136, 0.3);
    transform: translateY(-1px);
}

.btn-outline-primary {
    color: var(--primary);
    border-color: var(--primary);
    font-weight: 600;
    border-radius: var(--radius-md);
}

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

/* Auth / Login Page styling */
.login-page-bg {
    min-height: 100vh;
    background: radial-gradient(circle at 10% 20%, rgba(13, 148, 136, 0.08) 0%, rgba(79, 70, 229, 0.05) 90%), #f8fafc;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem 1rem;
}

.login-card {
    background: #ffffff;
    border-radius: var(--radius-xl);
    border: 1px solid var(--border-color);
    box-shadow: 0 25px 50px -12px rgba(15, 23, 42, 0.12);
    width: 100%;
    max-width: 480px;
    padding: 2.5rem;
}

.demo-account-pill {
    background: #f8fafc;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 0.65rem 0.9rem;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 0.85rem;
}

.demo-account-pill:hover {
    background: #f1f5f9;
    border-color: var(--primary);
    transform: translateY(-2px);
    box-shadow: var(--shadow-sm);
}

/* Day-End Shift Report (Z-Report) & Receipts */
@media print {
    body {
        background: #ffffff !important;
        color: #000000 !important;
        font-size: 12pt;
    }
    .app-sidebar, .app-navbar, .no-print, .btn, .content-card-header .btn-group {
        display: none !important;
    }
    .app-main {
        margin-left: 0 !important;
        width: 100% !important;
    }
    .page-container {
        padding: 0 !important;
    }
    .content-card {
        border: none !important;
        box-shadow: none !important;
    }
    .thermal-receipt {
        width: 80mm !important;
        margin: 0 auto !important;
        padding: 5mm !important;
        border: none !important;
    }
}

/* Thermal POS 80mm Container */
.thermal-receipt {
    max-width: 360px;
    margin: 0 auto;
    background: #ffffff;
    border: 1px dashed #cbd5e1;
    border-radius: var(--radius-md);
    padding: 1.5rem;
    font-family: 'Courier New', Courier, monospace;
}

/* Prescription Styles */
.rx-header {
    border-bottom: 2px solid var(--primary);
    padding-bottom: 1.25rem;
    margin-bottom: 1.5rem;
}

.rx-symbol {
    font-family: 'Outfit', sans-serif;
    font-size: 2.25rem;
    font-weight: 700;
    color: var(--primary);
    line-height: 1;
}

/* Responsive adjust */
@media (max-width: 991.98px) {
    .app-sidebar {
        transform: translateX(-100%);
    }
    .app-sidebar.show {
        transform: translateX(0);
    }
    .app-main {
        margin-left: 0;
        width: 100%;
    }
}

.transition-hover {
    transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.2s ease, border-color 0.2s ease;
}
.transition-hover:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.08), 0 8px 10px -6px rgba(0, 0, 0, 0.04) !important;
    border-color: rgba(13, 148, 136, 0.35) !important;
}
