/* =========================================
   WebDental Pro UI
   Author: Arnel Tristan A. Cruz
   Course: IS226 - Web Information Systems
   ========================================= */

:root {
    --primary: #2563eb;
    --primary-dark: #1d4ed8;
    --primary-soft: #eff6ff;
    --success: #16a34a;
    --warning: #f59e0b;
    --danger: #dc2626;
    --info: #0891b2;
    --bg: #f3f6fb;
    --sidebar: #0f172a;
    --sidebar-hover: #1e293b;
    --surface: #ffffff;
    --surface-soft: #f8fafc;
    --text: #0f172a;
    --muted: #64748b;
    --border: #e2e8f0;
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 18px;
    --shadow-sm: 0 1px 3px rgba(15, 23, 42, 0.08);
    --shadow-md: 0 8px 24px rgba(15, 23, 42, 0.08);
    --font-main: "Inter", "Segoe UI", system-ui, sans-serif;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: var(--font-main);
    background: var(--bg);
    color: var(--text);
}

.app-shell {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: 260px;
    background: var(--sidebar);
    color: white;
    padding: 24px 18px;
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
}

.brand {
    font-size: 20px;
    font-weight: 800;
    margin-bottom: 6px;
    letter-spacing: -0.3px;
}

.brand span {
    color: #93c5fd;
}

.brand-subtitle {
    color: #94a3b8;
    font-size: 12px;
    margin-bottom: 28px;
}

.sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.sidebar-nav a {
    color: #cbd5e1;
    text-decoration: none;
    padding: 12px 14px;
    border-radius: var(--radius-sm);
    font-size: 14px;
    transition: 0.2s ease;
}

.sidebar-nav a:hover,
.sidebar-nav a.active {
    background: var(--sidebar-hover);
    color: white;
}

.main-content {
    margin-left: 260px;
    width: calc(100% - 260px);
    padding: 28px;
}

.topbar {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 18px 22px;
    margin-bottom: 24px;
    box-shadow: var(--shadow-sm);
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
}

.page-title {
    font-size: 24px;
    font-weight: 800;
    letter-spacing: -0.4px;
}

.page-subtitle {
    font-size: 14px;
    color: var(--muted);
    margin-top: 4px;
}

.user-chip {
    display: flex;
    align-items: center;
    gap: 10px;
    background: var(--surface-soft);
    border: 1px solid var(--border);
    padding: 8px 12px;
    border-radius: 999px;
    font-size: 14px;
    white-space: nowrap;
}

.hero-panel {
    background: linear-gradient(135deg, #1d4ed8, #0891b2);
    color: white;
    border-radius: 24px;
    padding: 26px;
    margin-bottom: 24px;
    box-shadow: var(--shadow-md);
}

.hero-kicker {
    font-size: 13px;
    opacity: 0.85;
    margin-bottom: 6px;
}

.hero-title {
    font-size: 30px;
    font-weight: 800;
    letter-spacing: -0.8px;
}

.hero-text {
    margin-top: 8px;
    max-width: 840px;
    color: #dbeafe;
}

.dashboard-grid,
.grid-4 {
    display: grid;
    grid-template-columns: repeat(4, minmax(180px, 1fr));
    gap: 18px;
    margin-bottom: 24px;
}

.grid-2 {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
}

.card,
.stat-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 22px;
    box-shadow: var(--shadow-sm);
    margin-bottom: 24px;
}

.stat-card {
    transition: 0.2s ease;
}

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

.stat-label {
    font-size: 13px;
    color: var(--muted);
    margin-bottom: 8px;
}

.stat-value {
    font-size: 30px;
    font-weight: 800;
    letter-spacing: -0.8px;
}

.stat-note {
    margin-top: 8px;
    font-size: 12px;
    color: var(--success);
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 14px;
    margin-bottom: 18px;
}

.card-title {
    font-size: 18px;
    font-weight: 800;
}

.card-description {
    font-size: 13px;
    color: var(--muted);
    margin-top: 4px;
}

.table-wrapper {
    overflow-x: auto;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
}

table,
.table {
    width: 100%;
    border-collapse: collapse;
    background: white;
}

.table th,
.table td,
th,
td {
    padding: 14px;
    border-bottom: 1px solid var(--border);
    text-align: left;
    font-size: 14px;
    vertical-align: top;
}

.table th,
th {
    background: var(--surface-soft);
    color: var(--muted);
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    font-weight: 800;
}

.table tr:hover td,
tr:hover td {
    background: #f8fafc;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 18px;
}

.form-group,
.field {
    margin-bottom: 16px;
}

label {
    display: block;
    font-size: 13px;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 6px;
}

input,
select,
textarea {
    width: 100%;
    padding: 11px 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 14px;
    background: white;
    transition: 0.2s ease;
}

textarea {
    min-height: 86px;
    resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px var(--primary-soft);
    outline: none;
}

.toolbar {
    display: flex;
    gap: 16px;
    align-items: end;
    flex-wrap: wrap;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border: none;
    border-radius: var(--radius-sm);
    padding: 10px 16px;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    text-decoration: none;
    transition: 0.2s ease;
    background: var(--primary);
    color: white;
}

.btn:hover {
    transform: translateY(-1px);
}

.btn-primary {
    background: var(--primary);
    color: white;
}

.btn-primary:hover {
    background: var(--primary-dark);
}

.btn-secondary,
.btn.secondary {
    background: var(--surface-soft);
    color: var(--text);
    border: 1px solid var(--border);
}

.btn-danger,
.btn.danger {
    background: var(--danger);
    color: white;
}

.btn-success,
.btn.ok {
    background: var(--success);
    color: white;
}

.btn-sm {
    padding: 7px 11px;
    font-size: 12px;
}

.actions {
    display: flex;
    gap: 8px;
    align-items: center;
}

.badge {
    display: inline-flex;
    align-items: center;
    padding: 5px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 800;
    background: #e0f2fe;
    color: #075985;
}

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

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

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

.report-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 18px;
}

.report-card {
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 20px;
    background: linear-gradient(180deg, #ffffff, #f8fafc);
}

.flash {
    padding: 12px 14px;
    border-radius: var(--radius-md);
    margin-bottom: 18px;
    font-weight: 700;
}

.success {
    background: #dcfce7;
    color: #166534;
}

.error {
    background: #fee2e2;
    color: #991b1b;
}

.muted {
    color: var(--muted);
}

.footer {
    margin-top: 32px;
    color: var(--muted);
    font-size: 12px;
    text-align: center;
}

@media (max-width: 1000px) {
    .sidebar {
        position: static;
        width: 100%;
    }

    .app-shell {
        flex-direction: column;
    }

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

    .dashboard-grid,
    .grid-4,
    .grid-2,
    .report-grid,
    .form-grid {
        grid-template-columns: 1fr;
    }

    .topbar {
        align-items: flex-start;
        flex-direction: column;
    }
}
