/* Shared modern UI styles for the entire cskh-online admin panel */
:root {
    --bg: #eef4fb;
    --surface: #ffffff;
    --surface-soft: #f8fafc;
    --text: #111827;
    --muted: #64748b;
    --primary: #2563eb;
    --primary-strong: #1d4ed8;
    --primary-soft: rgba(37,99,235,.12);
    --border: rgba(148,163,184,.18);
    --shadow: 0 25px 60px rgba(15,23,42,.08);
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: Inter, "Segoe UI", system-ui, -apple-system, BlinkMacSystemFont, "Helvetica Neue", Arial, sans-serif;
    color: var(--text);
    background: radial-gradient(circle at top left, rgba(59,130,246,.15), transparent 25%), linear-gradient(180deg, #f8fbff 0%, #eef4fb 100%);
}

.wrapper-flex {
    min-height: 100vh;
    display: flex;
    align-items: stretch;
    overflow: hidden;
}

.sidebar {
    min-height: 100vh;
    width: 260px;
    min-width: 260px;
    flex-shrink: 0;
    background: linear-gradient(180deg, #0f172a 0%, #111827 100%);
    color: #cbd5e1;
    box-shadow: 0 24px 80px rgba(15,23,42,.18);
    overflow-y: auto;
}

.sidebar-brand {
    padding: 26px 22px;
    font-size: 1.1rem;
    font-weight: 700;
    letter-spacing: .01em;
    color: #ffffff;
    border-bottom: 1px solid rgba(255,255,255,.08);
    text-align: center;
}

.sidebar-nav {
    padding: 12px 0 24px;
}

.sidebar-nav small {
    display: block;
    padding: 0 24px 8px;
    font-size: .75rem;
    letter-spacing: .16em;
    text-transform: uppercase;
    color: #94a3b8;
}

.sidebar-nav a {
    display: block;
    margin: 5px 14px;
    padding: 13px 18px;
    border-radius: 999px 0 0 999px;
    color: #cbd5e1;
    text-decoration: none;
    font-size: .95rem;
    font-weight: 500;
    transition: all .25s ease;
}

.sidebar-nav a i {
    width: 28px;
    display: inline-block;
    text-align: center;
    margin-right: 10px;
    color: #60a5fa;
}

.sidebar-nav a:hover,
.sidebar-nav a.active {
    background: rgba(59,130,246,.16);
    color: #ffffff;
    box-shadow: inset 4px 0 0 rgba(59,130,246,.95);
}

.sidebar-nav a.active i {
    color: #ffffff;
}

.main-content {
    flex: 1 1 0;
    min-width: 0;
    width: 0;
    padding: 30px 34px;
    overflow-x: hidden;
    overflow-y: auto;
}

.card,
.table-responsive,
.alert {
    border-radius: 1.15rem;
    background: rgba(255,255,255,.98);
    box-shadow: var(--shadow);
    border: 1px solid rgba(148,163,184,.15);
}

.card {
    border: none;
}

.card-header {
    background: rgba(15,23,42,.96);
    color: #ffffff;
    border: none;
    border-radius: 1.15rem 1.15rem 0 0;
    font-weight: 700;
}

.btn-primary {
    background-color: var(--primary);
    border-color: var(--primary);
    box-shadow: 0 12px 22px rgba(37,99,235,.18);
}

.btn-primary:hover,
.btn-primary:focus {
    background-color: var(--primary-strong);
    border-color: var(--primary-strong);
}

.btn-secondary,
.btn-outline-secondary {
    border: none;
    box-shadow: 0 12px 22px rgba(15,23,42,.08);
}

.btn-outline-primary {
    color: var(--primary);
    border-color: rgba(37,99,235,.45);
}

.btn-outline-primary:hover {
    background: rgba(37,99,235,.08);
}

.form-control,
.form-select,
textarea.form-control {
    background: var(--surface-soft);
    border: 1px solid rgba(148,163,184,.35);
    border-radius: 1rem;
    box-shadow: inset 0 1px 2px rgba(15,23,42,.05);
    transition: border-color .25s ease, box-shadow .25s ease;
}

.form-control:focus,
.form-select:focus,
textarea.form-control:focus {
    border-color: rgba(59,130,246,.75);
    box-shadow: 0 0 0 4px rgba(59,130,246,.12);
    outline: none;
}

.table {
    border-collapse: separate;
    border-spacing: 0;
}

.table thead th {
    border-bottom: 1px solid rgba(148,163,184,.18);
    background: rgba(15,23,42,.95);
    color: #fff;
    text-transform: uppercase;
    font-size: .82rem;
    letter-spacing: .04em;
}

.table tbody tr {
    background: #ffffff;
}

.table tbody tr:hover {
    background: #f8fbff;
}

.table td,
.table th {
    border-top: 1px solid rgba(148,163,184,.18);
    vertical-align: middle;
}

.table-responsive {
    border-radius: 1.15rem;
    overflow: hidden;
    background: rgba(255,255,255,.98);
    border: 1px solid rgba(148,163,184,.15);
}

.alert {
    border: none;
}

.badge {
    border-radius: .85rem;
    padding: .55em .9em;
}

.text-muted {
    color: var(--muted) !important;
}

.content-section {
    margin-bottom: 1.75rem;
}

@media (max-width: 992px) {
    .wrapper-flex {
        flex-direction: column;
        overflow: visible;
    }

    .sidebar {
        width: 100%;
        min-width: 0;
        min-height: auto;
        overflow-y: visible;
    }

    .sidebar-nav a {
        border-radius: 0;
        margin: 0;
    }

    .main-content {
        width: 100%;
        min-width: 0;
        padding: 22px 16px;
        overflow-x: hidden;
    }
}

@media (max-width: 768px) {
    .sidebar-nav small {
        padding-left: 16px;
    }

    .sidebar-nav a {
        margin: 0 8px;
    }

    .main-content {
        padding: 16px 12px;
    }
}
