:root {
    --bg: #f8f6f1;
    --bg-soft: #fcfbf8;
    --surface: rgba(255, 255, 255, 0.88);
    --surface-strong: #ffffff;
    --line: #e9e2d6;
    --line-soft: #f1ece3;

    --text: #1d2433;
    --text-soft: #6d7485;
    --text-muted: #9399a6;

    --primary: #1d4ed8;
    --primary-soft: #e8f0ff;

    --gold: #c8a95b;
    --gold-soft: #f8f1df;

    --success: #15803d;
    --success-bg: #eaf8ef;

    --danger: #b42318;
    --danger-bg: #fdecec;

    --warning: #b7791f;
    --warning-bg: #fff8e8;

    --shadow-sm: 0 8px 22px rgba(23, 29, 41, 0.06);
    --shadow-md: 0 16px 40px rgba(23, 29, 41, 0.08);
    --shadow-lg: 0 24px 70px rgba(23, 29, 41, 0.12);

    --radius-sm: 10px;
    --radius-md: 16px;
    --radius-lg: 24px;
    --radius-xl: 32px;

    --sidebar-width: 270px;
    --transition: 0.25s ease;
}

* {
    box-sizing: border-box;
}

html, body {
    margin: 0;
    padding: 0;
    font-family: "Inter", "Segoe UI", Arial, sans-serif;
    background:
        radial-gradient(circle at top left, #fff7e8 0%, transparent 28%),
        radial-gradient(circle at bottom right, #eef4ff 0%, transparent 22%),
        var(--bg);
    color: var(--text);
}

a {
    color: inherit;
    text-decoration: none;
}

img {
    max-width: 100%;
}

button,
input,
select,
textarea {
    font: inherit;
}

.auth-page {
    min-height: 100vh;
    display: grid;
    grid-template-columns: 1.08fr 0.92fr;
}

.auth-side {
    padding: 56px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.auth-brand {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 40px;
}

.auth-logo {
    width: 52px;
    height: 52px;
    border-radius: 18px;
    background: linear-gradient(135deg, #fff5d8, #f3e3a9);
    box-shadow: inset 0 1px 0 rgba(255,255,255,.8), var(--shadow-sm);
    display: grid;
    place-items: center;
    color: #8b6a1e;
    font-size: 24px;
    font-weight: 700;
}

.auth-brand h1 {
    margin: 0;
    font-size: 22px;
    font-weight: 700;
    letter-spacing: -0.02em;
}

.auth-brand p {
    margin: 4px 0 0;
    color: var(--text-soft);
    font-size: 14px;
}

.auth-copy {
    max-width: 640px;
}

.auth-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 9px 14px;
    border-radius: 999px;
    background: rgba(255,255,255,0.7);
    border: 1px solid rgba(200,169,91,.25);
    color: #8b6a1e;
    font-size: 13px;
    font-weight: 600;
    backdrop-filter: blur(12px);
    margin-bottom: 22px;
}

.auth-copy h2 {
    margin: 0 0 14px;
    font-size: 52px;
    line-height: 1.06;
    letter-spacing: -0.04em;
}

.auth-copy p {
    margin: 0;
    color: var(--text-soft);
    font-size: 17px;
    line-height: 1.75;
    max-width: 560px;
}

.auth-features {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
    margin-top: 36px;
}

.feature-card {
    background: rgba(255,255,255,0.7);
    border: 1px solid var(--line-soft);
    border-radius: 22px;
    padding: 18px;
    backdrop-filter: blur(12px);
    box-shadow: var(--shadow-sm);
}

.feature-card .icon {
    width: 42px;
    height: 42px;
    border-radius: 14px;
    display: grid;
    place-items: center;
    background: linear-gradient(135deg, #fdf6e5, #f7e9c3);
    color: #8b6a1e;
    margin-bottom: 14px;
    font-weight: 700;
}

.feature-card h3 {
    margin: 0 0 6px;
    font-size: 15px;
}

.feature-card p {
    margin: 0;
    font-size: 13px;
    line-height: 1.6;
    color: var(--text-soft);
}

.auth-panel {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px;
}

.auth-card {
    width: 100%;
    max-width: 460px;
    background: rgba(255,255,255,0.82);
    border: 1px solid rgba(255,255,255,0.9);
    border-radius: 30px;
    padding: 34px;
    backdrop-filter: blur(18px);
    box-shadow: var(--shadow-lg);
    position: relative;
    overflow: hidden;
}

.auth-card::before {
    content: "";
    position: absolute;
    inset: 0 0 auto 0;
    height: 6px;
    background: linear-gradient(90deg, #d9b76a, #f4e5b5, #caa24d);
}

.auth-card h3 {
    margin: 10px 0 8px;
    font-size: 30px;
    letter-spacing: -0.03em;
}

.auth-card .subtext {
    margin: 0 0 26px;
    color: var(--text-soft);
    line-height: 1.7;
    font-size: 14px;
}

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

.form-label {
    display: block;
    margin-bottom: 8px;
    font-size: 14px;
    font-weight: 600;
    color: var(--text);
}

.form-input {
    width: 100%;
    padding: 14px 16px;
    border-radius: 16px;
    border: 1px solid var(--line);
    background: rgba(255,255,255,0.88);
    color: var(--text);
    transition: border-color var(--transition), box-shadow var(--transition), transform var(--transition);
    outline: none;
}

.form-input::placeholder {
    color: var(--text-muted);
}

.form-input:focus {
    border-color: rgba(29, 78, 216, 0.35);
    box-shadow: 0 0 0 4px rgba(29, 78, 216, 0.08);
    transform: translateY(-1px);
}

.btn {
    border: 0;
    border-radius: 16px;
    padding: 14px 18px;
    cursor: pointer;
    transition: transform var(--transition), box-shadow var(--transition), opacity var(--transition);
    font-weight: 700;
}

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

.btn-primary {
    width: 100%;
    color: #fff;
    background: linear-gradient(135deg, #2a5be7, #1744c6);
    box-shadow: 0 18px 30px rgba(29, 78, 216, 0.18);
}

.btn-primary:hover {
    box-shadow: 0 20px 34px rgba(29, 78, 216, 0.22);
}

.btn-light {
    background: #fff;
    border: 1px solid var(--line);
    color: var(--text);
}

.alert {
    padding: 14px 16px;
    border-radius: 16px;
    margin-bottom: 16px;
    font-size: 14px;
    line-height: 1.6;
    border: 1px solid transparent;
}

.alert-success {
    background: var(--success-bg);
    color: var(--success);
    border-color: #caeed6;
}

.alert-error {
    background: var(--danger-bg);
    color: var(--danger);
    border-color: #f6caca;
}

.alert-warning {
    background: var(--warning-bg);
    color: var(--warning);
    border-color: #f2deb2;
}

.auth-footer-note {
    margin-top: 18px;
    font-size: 13px;
    color: var(--text-muted);
    text-align: center;
}

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

.sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    width: 320px;
    max-width: 86%;
    height: 100dvh;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    background: #ffffff;
    z-index: 1200;
    padding-bottom: 24px;
}

body.sidebar-open {
    overflow: hidden;
}


.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 10px 10px 18px;
    border-bottom: 1px solid var(--line-soft);
    margin-bottom: 18px;
}

.sidebar-brand .logo {
    width: 46px;
    height: 46px;
    border-radius: 16px;
    background: linear-gradient(135deg, #fff5d6, #efd28a);
    display: grid;
    place-items: center;
    box-shadow: var(--shadow-sm);
    color: #7b5c15;
    font-weight: 800;
    font-size: 20px;
}

.sidebar-brand h2 {
    margin: 0;
    font-size: 18px;
    letter-spacing: -0.02em;
}

.sidebar-brand p {
    margin: 4px 0 0;
    font-size: 13px;
    color: var(--text-soft);
}

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

.nav-title {
    margin: 14px 10px 8px;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.08em;
    color: var(--text-muted);
    text-transform: uppercase;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 13px 14px;
    border-radius: 18px;
    color: var(--text-soft);
    transition: background var(--transition), color var(--transition), transform var(--transition);
}

.nav-link:hover,
.nav-link.active {
    background: linear-gradient(180deg, #fff9ed, #fff4d9);
    color: #7a5b16;
    transform: translateX(2px);
}

.nav-link .nav-icon {
    width: 38px;
    height: 38px;
    border-radius: 14px;
    display: grid;
    place-items: center;
    background: #fff;
    border: 1px solid var(--line-soft);
    box-shadow: var(--shadow-sm);
    font-size: 14px;
    font-weight: 700;
}

.sidebar-footer {
    margin-top: auto;
    padding: 14px;
    border-radius: 20px;
    background: linear-gradient(180deg, #fffdfa, #f8f3e9);
    border: 1px solid var(--line-soft);
    box-shadow: var(--shadow-sm);
}

.sidebar-footer .label {
    font-size: 12px;
    color: var(--text-muted);
}

.sidebar-footer .name {
    margin-top: 6px;
    font-weight: 700;
}

.content {
    flex: 1;
    margin-left: var(--sidebar-width);
    padding: 26px;
}

.topbar {
    background: rgba(255,255,255,0.72);
    border: 1px solid rgba(255,255,255,0.88);
    backdrop-filter: blur(18px);
    border-radius: 24px;
    padding: 18px 22px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    box-shadow: var(--shadow-sm);
    margin-bottom: 24px;
}

.topbar-left h1 {
    margin: 0;
    font-size: 30px;
    letter-spacing: -0.03em;
}

.topbar-left p {
    margin: 6px 0 0;
    color: var(--text-soft);
    font-size: 14px;
}

.topbar-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

.chip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: rgba(255,255,255,0.9);
    border: 1px solid var(--line);
    padding: 10px 14px;
    border-radius: 999px;
    font-size: 13px;
    color: var(--text-soft);
}

.grid {
    display: grid;
    gap: 20px;
}

.grid-4 {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.card {
    background: rgba(255,255,255,0.82);
    border: 1px solid rgba(255,255,255,0.9);
    border-radius: 26px;
    padding: 22px;
    backdrop-filter: blur(16px);
    box-shadow: var(--shadow-md);
}

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

.card-title {
    margin: 0;
    font-size: 16px;
    font-weight: 700;
}

.card-subtitle {
    margin: 6px 0 0;
    color: var(--text-soft);
    font-size: 13px;
    line-height: 1.6;
}

.stat-card {
    position: relative;
    overflow: hidden;
}

.stat-card::after {
    content: "";
    position: absolute;
    right: -30px;
    top: -30px;
    width: 110px;
    height: 110px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(241,224,179,0.55), transparent 68%);
}

.stat-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
}

.stat-icon {
    width: 52px;
    height: 52px;
    border-radius: 18px;
    display: grid;
    place-items: center;
    background: linear-gradient(135deg, #fff6df, #f5e4b1);
    color: #7f611a;
    box-shadow: var(--shadow-sm);
    font-size: 18px;
    font-weight: 700;
}

.stat-label {
    color: var(--text-soft);
    font-size: 14px;
    margin-bottom: 12px;
}

.stat-value {
    font-size: 34px;
    font-weight: 800;
    letter-spacing: -0.04em;
    margin: 0;
}

.stat-meta {
    margin-top: 10px;
    color: var(--text-muted);
    font-size: 13px;
}

.two-col {
    display: grid;
    grid-template-columns: 1.6fr 1fr;
    gap: 20px;
    margin-top: 20px;
}

.table-wrap {
    width: 100%;
    overflow-x: auto;
}

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

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

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

.badge {
    display: inline-flex;
    align-items: center;
    padding: 8px 12px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 700;
}

.badge-success {
    background: var(--success-bg);
    color: var(--success);
}

.badge-warning {
    background: var(--warning-bg);
    color: var(--warning);
}

.badge-primary {
    background: var(--primary-soft);
    color: var(--primary);
}

.list {
    display: grid;
    gap: 14px;
}

.list-item {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 14px;
    padding: 14px;
    border-radius: 18px;
    background: rgba(255,255,255,0.72);
    border: 1px solid var(--line-soft);
}

.list-item h4 {
    margin: 0 0 5px;
    font-size: 14px;
}

.list-item p {
    margin: 0;
    font-size: 13px;
    color: var(--text-soft);
    line-height: 1.6;
}

.mobile-menu-btn {
    display: none;
    border: 0;
    background: #fff;
    width: 44px;
    height: 44px;
    border-radius: 14px;
    box-shadow: var(--shadow-sm);
    cursor: pointer;
}

.overlay {
    display: none;
}

@media (max-width: 1200px) {
    .grid-4 {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .two-col {
        grid-template-columns: 1fr;
    }

    .auth-copy h2 {
        font-size: 42px;
    }
}

@media (max-width: 992px) {
    .auth-page {
        grid-template-columns: 1fr;
    }

    .auth-side {
        padding: 28px 22px 12px;
    }

    .auth-panel {
        padding: 16px 22px 28px;
    }

    .auth-features {
        grid-template-columns: 1fr;
    }

    .sidebar {
        transform: translateX(-100%);
        transition: transform var(--transition);
    }

    .sidebar.open {
        transform: translateX(0);
    }

    .overlay.show {
        display: block;
        position: fixed;
        inset: 0;
        background: rgba(17, 24, 39, 0.28);
        z-index: 105;
    }

    .content {
        margin-left: 0;
        padding: 18px;
    }

    .mobile-menu-btn {
        display: inline-grid;
        place-items: center;
    }

    .topbar {
        padding: 16px;
        border-radius: 20px;
    }

    .topbar-left h1 {
        font-size: 24px;
    }
}

@media (max-width: 640px) {
    .auth-copy h2 {
        font-size: 34px;
    }

    .auth-card {
        padding: 26px 20px;
        border-radius: 24px;
    }

    .grid-4 {
        grid-template-columns: 1fr;
    }

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

    .topbar-right {
        justify-content: space-between;
        flex-wrap: wrap;
    }

    .card {
        border-radius: 22px;
        padding: 18px;
    }

    .sidebar {
        width: 86%;
        max-width: 320px;
    }
}
.page-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 20px;
}

.page-head h2 {
    margin: 0;
    font-size: 28px;
    letter-spacing: -0.03em;
}

.page-head p {
    margin: 6px 0 0;
    color: var(--text-soft);
    font-size: 14px;
}

.btn-row {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.btn-gold {
    background: linear-gradient(135deg, #d7b86a, #bf9a44);
    color: #fff;
    box-shadow: 0 18px 32px rgba(191, 154, 68, 0.22);
}

.btn-gold:hover {
    box-shadow: 0 20px 36px rgba(191, 154, 68, 0.28);
}

.btn-danger {
    background: linear-gradient(135deg, #d9534f, #ba2d2d);
    color: #fff;
}

.btn-sm {
    padding: 10px 14px;
    border-radius: 14px;
    font-size: 13px;
    font-weight: 700;
}

.form-card {
    max-width: 900px;
}

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

.form-grid .full {
    grid-column: 1 / -1;
}

.form-helper {
    margin-top: 8px;
    color: var(--text-muted);
    font-size: 12px;
    line-height: 1.6;
}

.form-select,
.form-textarea {
    width: 100%;
    padding: 14px 16px;
    border-radius: 16px;
    border: 1px solid var(--line);
    background: rgba(255,255,255,0.88);
    color: var(--text);
    transition: border-color var(--transition), box-shadow var(--transition), transform var(--transition);
    outline: none;
}

.form-textarea {
    min-height: 120px;
    resize: vertical;
}

.form-select:focus,
.form-textarea:focus {
    border-color: rgba(29, 78, 216, 0.35);
    box-shadow: 0 0 0 4px rgba(29, 78, 216, 0.08);
    transform: translateY(-1px);
}

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

.table-empty {
    text-align: center;
    color: var(--text-soft);
    padding: 28px 16px;
}

.breadcrumb {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 16px;
    color: var(--text-soft);
    font-size: 13px;
}

.breadcrumb a {
    color: var(--primary);
}

@media (max-width: 768px) {
    .form-grid {
        grid-template-columns: 1fr;
    }

    .page-head {
        flex-direction: column;
        align-items: stretch;
    }
}
.table {
    min-width: 900px;
}

.table th,
.table td {
    vertical-align: middle;
    white-space: normal;
}

.table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}
html, body {
    max-width: 100%;
    overflow-x: hidden;
}

body {
    font-size: 16px;
}

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

.content {
    flex: 1;
    margin-left: var(--sidebar-width);
    padding: 26px;
    min-width: 0;
}

.card,
.topbar,
.sidebar,
.auth-card,
.feature-card,
.list-item {
    min-width: 0;
}

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

.table {
    min-width: 1000px;
}

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

.form-grid .full {
    grid-column: 1 / -1;
}

.btn-row {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.topbar-right {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.page-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
}

@media (max-width: 992px) {
    .layout {
        display: block;
    }

    .sidebar {
        width: 86%;
        max-width: 320px;
        position: fixed;
        inset: 0 auto 0 0;
        transform: translateX(-100%);
        transition: transform .25s ease;
        z-index: 110;
    }

    .sidebar.open {
        transform: translateX(0);
    }

    .overlay.show {
        display: block;
        position: fixed;
        inset: 0;
        background: rgba(17, 24, 39, 0.28);
        z-index: 105;
    }

    .content {
        margin-left: 0 !important;
        width: 100%;
        max-width: 100%;
        padding: 16px;
    }

    .topbar {
        padding: 16px;
        border-radius: 20px;
        display: flex;
        flex-direction: column;
        align-items: stretch;
        gap: 14px;
    }

    .topbar-left h1 {
        font-size: 24px;
        line-height: 1.2;
        margin: 0;
    }

    .topbar-left p {
        font-size: 14px;
        line-height: 1.6;
        margin: 6px 0 0;
        word-break: break-word;
    }

    .topbar-right {
        width: 100%;
        display: flex;
        justify-content: space-between;
        align-items: center;
        gap: 10px;
        flex-wrap: wrap;
    }

    .mobile-menu-btn {
        display: inline-grid;
        place-items: center;
    }

    .page-head {
        flex-direction: column;
        align-items: stretch;
    }

    .form-grid {
        grid-template-columns: 1fr;
    }

    .card {
        padding: 18px;
        border-radius: 22px;
    }

    .table {
        min-width: 900px;
    }
}

@media (max-width: 640px) {
    .content {
        padding: 14px;
    }

    .topbar-left h1,
    .page-head h2 {
        font-size: 22px;
    }

    .btn,
    .btn-light,
    .btn-gold {
        width: auto;
        min-height: 46px;
    }

    .table {
        min-width: 820px;
    }

    .card-header {
        display: flex;
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
    }
}