/**
 * Modern Clinical Management SaaS Theme
 * CarePulse Healthcare Clinic
 */

:root {
    --primary: #2563eb;
    --primary-dark: #1d4ed8;
    --primary-light: #eff6ff;
    --secondary: #64748b;
    --success: #10b981;
    --success-light: #ecfdf5;
    --danger: #ef4444;
    --danger-light: #fef2f2;
    --warning: #f59e0b;
    --warning-light: #fffbeb;
    --info: #06b6d4;
    --info-light: #ecfeff;
    --dark: #0f172a;
    --sidebar-bg: #0f172a;
    --sidebar-hover: #1e293b;
    --sidebar-active: #2563eb;
    --sidebar-text: #94a3b8;
    --sidebar-text-active: #ffffff;
    --bg-body: #f8fafc;
    --card-border: #e2e8f0;
    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

body {
    font-family: var(--font-sans);
    background-color: var(--bg-body);
    color: #334155;
    overflow-x: hidden;
    min-height: 100vh;
}

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

/* Sidebar */
.app-sidebar {
    width: 260px;
    background-color: var(--sidebar-bg);
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    transition: all 0.3s ease;
    z-index: 1020;
}

.sidebar-brand {
    padding: 1.25rem 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: #ffffff;
    text-decoration: none;
    font-size: 1.15rem;
    font-weight: 700;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.sidebar-brand .brand-icon {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    background: linear-gradient(135deg, #2563eb, #38bdf8);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 1.1rem;
}

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

.sidebar-heading {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #64748b;
    padding: 0.75rem 0.75rem 0.35rem 0.75rem;
    font-weight: 700;
}

.nav-link-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.65rem 0.85rem;
    color: var(--sidebar-text);
    text-decoration: none;
    font-size: 0.875rem;
    font-weight: 500;
    border-radius: 8px;
    transition: all 0.2s ease;
    margin-bottom: 2px;
}

.nav-link-item i {
    width: 20px;
    font-size: 1rem;
    text-align: center;
}

.nav-link-item:hover {
    background-color: var(--sidebar-hover);
    color: #f8fafc;
}

.nav-link-item.active {
    background-color: var(--sidebar-active);
    color: var(--sidebar-text-active);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.35);
}

/* Main Content Area */
.app-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
}

/* Topbar */
.app-topbar {
    height: 65px;
    background: #ffffff;
    border-bottom: 1px solid var(--card-border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 1.5rem;
    position: sticky;
    top: 0;
    z-index: 1010;
}

.topbar-search {
    max-width: 320px;
    position: relative;
}

.topbar-search input {
    border-radius: 20px;
    padding-left: 2.25rem;
    background-color: #f1f5f9;
    border: 1px solid transparent;
    font-size: 0.875rem;
}

.topbar-search input:focus {
    background-color: #fff;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

.topbar-search i {
    position: absolute;
    left: 0.85rem;
    top: 50%;
    transform: translateY(-50%);
    color: #94a3b8;
}

/* Content Container */
.app-content {
    padding: 1.75rem 1.5rem;
    flex: 1;
}

/* Cards */
.card {
    border: 1px solid var(--card-border);
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
    background: #ffffff;
    transition: box-shadow 0.2s ease;
}

.card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06);
}

.card-header {
    background: transparent;
    border-bottom: 1px solid var(--card-border);
    padding: 1rem 1.25rem;
    font-weight: 600;
}

/* Stats / KPI Widget Cards */
.stat-card {
    padding: 1.25rem;
    border-radius: 12px;
    border: 1px solid var(--card-border);
    background: #ffffff;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: relative;
    overflow: hidden;
}

.stat-card .stat-icon {
    width: 48px;
    height: 48px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.35rem;
}

.stat-card .stat-value {
    font-size: 1.65rem;
    font-weight: 700;
    line-height: 1.2;
    color: #0f172a;
}

.stat-card .stat-title {
    font-size: 0.825rem;
    color: #64748b;
    font-weight: 500;
    margin-bottom: 0.25rem;
}

/* Color Accents */
.icon-primary { background: #eff6ff; color: #2563eb; }
.icon-success { background: #ecfdf5; color: #10b981; }
.icon-warning { background: #fffbeb; color: #f59e0b; }
.icon-danger  { background: #fef2f2; color: #ef4444; }
.icon-info    { background: #ecfeff; color: #06b6d4; }
.icon-purple  { background: #faf5ff; color: #9333ea; }

/* Custom Badges */
.badge-soft-success { background-color: #d1fae5; color: #065f46; font-weight: 600; }
.badge-soft-danger  { background-color: #fee2e2; color: #991b1b; font-weight: 600; }
.badge-soft-warning { background-color: #fef3c7; color: #92400e; font-weight: 600; }
.badge-soft-info    { background-color: #e0f2fe; color: #075985; font-weight: 600; }
.badge-soft-primary { background-color: #dbeafe; color: #1e40af; font-weight: 600; }
.badge-soft-secondary { background-color: #f1f5f9; color: #475569; font-weight: 600; }

/* Tables */
.table th {
    font-size: 0.785rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #64748b;
    font-weight: 600;
    background-color: #f8fafc;
    border-bottom: 1px solid var(--card-border);
    padding: 0.75rem 1rem;
}

.table td {
    padding: 0.85rem 1rem;
    vertical-align: middle;
    font-size: 0.875rem;
    color: #334155;
    border-bottom: 1px solid var(--card-border);
}

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

/* Patient profile & consultation cards */
.vitals-box {
    background-color: #f8fafc;
    border: 1px solid var(--card-border);
    border-radius: 8px;
    padding: 0.75rem;
    text-align: center;
}

.vitals-box .vitals-value {
    font-size: 1.25rem;
    font-weight: 700;
    color: #0f172a;
}

.vitals-box .vitals-label {
    font-size: 0.75rem;
    color: #64748b;
    font-weight: 500;
}

/* Live Queue Screen Styling */
.queue-board {
    background: linear-gradient(135deg, #0f172a, #1e293b);
    color: #fff;
    min-height: 100vh;
    padding: 2rem;
}

.token-big-card {
    background: rgba(255, 255, 255, 0.05);
    border: 2px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    padding: 2rem;
    text-align: center;
    backdrop-filter: blur(10px);
}

.token-huge-number {
    font-size: 5.5rem;
    font-weight: 900;
    color: #38bdf8;
    line-height: 1;
    margin: 1rem 0;
    text-shadow: 0 0 30px rgba(56, 189, 248, 0.4);
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 3rem 1.5rem;
}

.empty-state .empty-icon {
    font-size: 3rem;
    color: #cbd5e1;
    margin-bottom: 1rem;
}

/* Responsive adjustments */
@media (max-width: 992px) {
    .app-sidebar {
        position: fixed;
        left: -260px;
        top: 0;
        bottom: 0;
    }
    .app-sidebar.show {
        left: 0;
    }
}
