@import url('open-iconic/font/css/open-iconic-bootstrap.min.css');

/* ── Variables ─────────────────────────────────────── */
:root {
    --primary:       #3b82f6;
    --primary-dark:  #2563eb;
    --success:       #10b981;
    --warning:       #f59e0b;
    --danger:        #ef4444;
    --sidebar-bg:    #0f172a;
    --sidebar-hover: rgba(255,255,255,0.08);
    --sidebar-active:rgba(59,130,246,0.25);
    --bg:            #f1f5f9;
    --surface:       #ffffff;
    --border:        #e2e8f0;
    --text:          #1e293b;
    --text-muted:    #64748b;
    --radius:        10px;
    --shadow-sm:     0 1px 3px rgba(0,0,0,0.08), 0 1px 2px rgba(0,0,0,0.05);
    --shadow:        0 4px 6px rgba(0,0,0,0.07), 0 2px 4px rgba(0,0,0,0.05);
    --shadow-md:     0 10px 15px rgba(0,0,0,0.08), 0 4px 6px rgba(0,0,0,0.04);
}

/* ── Base ───────────────────────────────────────────── */
html, body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-size: 14px;
    color: var(--text);
    background-color: var(--bg);
}

h1 { font-size: 1.6rem; font-weight: 700; color: var(--text); }
h1:focus { outline: none; }

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

/* ── Content area ───────────────────────────────────── */
.content {
    padding: 1.5rem 2rem;
}

@media (max-width: 575.98px) {
    .content {
        padding: 1rem;
    }

    h1 {
        font-size: 1.3rem;
    }

    .display-6 {
        font-size: 1.4rem !important;
    }
}

/* ── Bootstrap overrides ────────────────────────────── */

/* Buttons */
.btn {
    font-weight: 500;
    border-radius: 8px;
    font-size: 0.85rem;
    padding: 0.45rem 1rem;
    transition: all 0.15s ease;
}
.btn-primary {
    background-color: var(--primary);
    border-color: var(--primary);
    color: #fff;
}
.btn-primary:hover {
    background-color: var(--primary-dark);
    border-color: var(--primary-dark);
}
.btn-secondary {
    background-color: #f1f5f9;
    border-color: #e2e8f0;
    color: var(--text);
}
.btn-secondary:hover {
    background-color: #e2e8f0;
    border-color: #cbd5e1;
    color: var(--text);
}
.btn-sm {
    padding: 0.3rem 0.7rem;
    font-size: 0.78rem;
    border-radius: 6px;
}
.btn-outline-primary  { border-color: var(--primary); color: var(--primary); }
.btn-outline-primary:hover  { background-color: var(--primary); color: #fff; }
.btn-outline-secondary { border-color: var(--border); color: var(--text-muted); }
.btn-outline-secondary:hover { background-color: var(--bg); color: var(--text); }
.btn-outline-danger { border-color: #fecaca; color: var(--danger); }
.btn-outline-danger:hover { background-color: var(--danger); color: #fff; border-color: var(--danger); }

.btn:focus, .btn:active:focus, .form-control:focus, .form-check-input:focus {
    box-shadow: 0 0 0 3px rgba(59,130,246,0.2);
}

/* Cards */
.card {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
}
.card-header {
    background-color: #f8fafc;
    border-bottom: 1px solid var(--border);
    font-weight: 600;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    padding: 0.75rem 1.25rem;
    border-radius: var(--radius) var(--radius) 0 0 !important;
}

/* KPI cards */
.card.text-white .card-body { padding: 1.5rem; }
.card.text-white h5.card-title {
    font-size: 0.78rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    opacity: 0.85;
    margin-bottom: 0.75rem;
}
.card.text-white .display-4 {
    font-size: 2.2rem;
    font-weight: 700;
    line-height: 1;
}
.card.bg-primary { background-color: var(--primary) !important; border: none; box-shadow: var(--shadow-md); }
.card.bg-success  { background-color: var(--success)  !important; border: none; box-shadow: var(--shadow-md); }
.card.bg-warning  { background-color: var(--warning)  !important; border: none; box-shadow: var(--shadow-md); }

/* Table */
.table {
    background: var(--surface);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border);
    font-size: 0.875rem;
}
.table thead th {
    background-color: #f8fafc;
    color: var(--text-muted);
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    border-bottom: 1px solid var(--border);
    padding: 0.85rem 1rem;
}
.table td {
    padding: 0.85rem 1rem;
    vertical-align: middle;
    border-color: #f1f5f9;
    color: var(--text);
}
.table-striped > tbody > tr:nth-of-type(odd) > td {
    background-color: #fafbfc;
}
.table tbody tr:hover td {
    background-color: #f0f7ff;
}

/* Badges */
.badge {
    font-weight: 500;
    font-size: 0.72rem;
    padding: 0.35em 0.65em;
    border-radius: 6px;
}
.bg-primary { background-color: var(--primary) !important; }
.bg-success  { background-color: var(--success)  !important; }
.bg-secondary { background-color: #94a3b8 !important; }

/* Forms */
.form-control, .form-select {
    border-radius: 8px;
    border: 1px solid var(--border);
    font-size: 0.875rem;
    color: var(--text);
    padding: 0.5rem 0.75rem;
    transition: border-color 0.15s, box-shadow 0.15s;
}
.form-control:focus, .form-select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(59,130,246,0.15);
}
.form-label {
    font-weight: 500;
    font-size: 0.825rem;
    color: var(--text-muted);
    margin-bottom: 0.4rem;
}

/* Progress */
.progress {
    border-radius: 999px;
    background-color: #e2e8f0;
    height: 8px !important;
}
.progress-bar {
    background-color: var(--primary);
    border-radius: 999px;
    font-size: 0;
}

/* Validation */
.valid.modified:not([type=checkbox]) { outline: 1px solid var(--success); }
.invalid { outline: 1px solid var(--danger); }
.validation-message { color: var(--danger); font-size: 0.8rem; }

/* Blazor error */
#blazor-error-ui {
    background: #fef9c3;
    border-top: 1px solid #fde047;
    bottom: 0; left: 0;
    display: none;
    padding: 0.6rem 1.25rem 0.7rem 1.25rem;
    position: fixed;
    width: 100%; z-index: 1000;
    font-size: 0.85rem;
}
#blazor-error-ui .dismiss {
    cursor: pointer;
    position: absolute;
    right: 0.75rem; top: 0.5rem;
}

/* ── Sidebar user section ───────────────────────────── */
.sidebar-user {
    padding: 1rem;
    border-top: 1px solid rgba(255,255,255,0.1);
    margin-top: auto;
}

.sidebar-user-info {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    margin-bottom: 0.5rem;
}

.sidebar-user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, #3b82f6, #1d4ed8);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.9rem;
    flex-shrink: 0;
}

.sidebar-user-details {
    overflow: hidden;
}

.sidebar-user-name {
    color: white;
    font-size: 0.85rem;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sidebar-user-email {
    color: rgba(255,255,255,0.5);
    font-size: 0.72rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
