:root {
    --tl-primary: #e91e63;
    --tl-primary-dark: #c2185b;
    --tl-dark: #15151f;
    --tl-soft: #f7f7fb;
    --tl-border: #e8e8ef;
    --tl-text: #232336;
    --tl-muted: #74748a;
    --tl-radius: 18px;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: "Google Sans", "Noto Sans Thai", sans-serif;
    background: var(--tl-soft);
    color: var(--tl-text);
}

a {
    text-decoration: none;
}

.tl-navbar {
    background: linear-gradient(135deg, #15151f, #2d2d3f);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
}

.brand-icon {
    width: 34px;
    height: 34px;
    border-radius: 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--tl-primary);
    color: #fff;
}

.tl-layout {
    display: grid;
    grid-template-columns: 270px 1fr;
    min-height: calc(100vh - 56px);
}

.tl-sidebar {
    background: #fff;
    border-right: 1px solid var(--tl-border);
    padding: 20px 16px;
    position: sticky;
    top: 56px;
    height: calc(100vh - 56px);
    overflow-y: auto;
}

.sidebar-title {
    font-weight: 700;
    color: var(--tl-muted);
    font-size: 0.92rem;
    margin-bottom: 14px;
    display: flex;
    gap: 8px;
    align-items: center;
}

.sidebar-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    color: var(--tl-text);
    border-radius: 14px;
    margin-bottom: 6px;
    font-weight: 500;
    transition: 0.15s ease;
}

.sidebar-link:hover {
    background: #fce4ef;
    color: var(--tl-primary-dark);
}

.sidebar-link i {
    font-size: 1.1rem;
}

.tl-main {
    padding: 26px;
}

.page-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
    margin-bottom: 22px;
}

.page-header h1 {
    font-size: 1.7rem;
    font-weight: 800;
    margin: 0 0 6px;
}

.page-header p {
    margin: 0;
    color: var(--tl-muted);
}

.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 16px;
    margin-bottom: 22px;
}

.stat-card {
    color: #fff;
    padding: 20px;
    border-radius: var(--tl-radius);
    display: flex;
    align-items: center;
    gap: 16px;
    box-shadow: 0 12px 30px rgba(20, 20, 30, 0.10);
    min-height: 112px;
}

.stat-icon {
    width: 54px;
    height: 54px;
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.20);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.6rem;
}

.stat-number {
    font-size: 2rem;
    font-weight: 800;
    line-height: 1;
}

.stat-label {
    opacity: 0.95;
    margin-top: 6px;
}

.bg-blue {
    background: linear-gradient(135deg, #2563eb, #1d4ed8);
}

.bg-green {
    background: linear-gradient(135deg, #16a34a, #15803d);
}

.bg-purple {
    background: linear-gradient(135deg, #7c3aed, #6d28d9);
}

.bg-orange {
    background: linear-gradient(135deg, #ea580c, #c2410c);
}

.bg-red {
    background: linear-gradient(135deg, #991b1b, #dc2626);
}

.content-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 18px;
}

.panel-card {
    background: #fff;
    border: 1px solid var(--tl-border);
    border-radius: var(--tl-radius);
    box-shadow: 0 12px 30px rgba(20, 20, 30, 0.06);
    padding: 18px;
}

.panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 14px;
    margin-bottom: 14px;
}

.panel-header h2 {
    font-size: 1.14rem;
    font-weight: 800;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.table {
    margin-bottom: 0;
}

.table thead th {
    color: var(--tl-muted);
    font-size: 0.9rem;
    font-weight: 700;
    border-bottom: 1px solid var(--tl-border);
}

.empty-box {
    border: 1px dashed var(--tl-border);
    background: #fafafa;
    border-radius: 16px;
    padding: 34px;
    text-align: center;
    color: var(--tl-muted);
}

.empty-box i {
    font-size: 2.4rem;
    display: block;
    margin-bottom: 8px;
}

.empty-box p {
    margin: 0;
}

.tl-footer {
    padding: 18px 26px;
    text-align: center;
    border-top: 1px solid var(--tl-border);
    background: #fff;
}

/* Login */
.login-page {
    min-height: 100vh;
    background:
        radial-gradient(circle at top left, rgba(233, 30, 99, 0.25), transparent 34%),
        radial-gradient(circle at bottom right, rgba(37, 99, 235, 0.22), transparent 34%),
        linear-gradient(135deg, #15151f, #2d2d3f);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 26px;
}

.login-card {
    width: 100%;
    max-width: 430px;
    background: #fff;
    border-radius: 26px;
    padding: 30px;
    box-shadow: 0 24px 70px rgba(0, 0, 0, 0.28);
}

.login-logo {
    text-align: center;
    margin-bottom: 22px;
}

.login-logo-icon {
    width: 72px;
    height: 72px;
    border-radius: 24px;
    margin: 0 auto 14px;
    background: linear-gradient(135deg, var(--tl-primary), #7c3aed);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
}

.login-logo h1 {
    margin: 0;
    font-weight: 800;
    font-size: 1.8rem;
}

.login-logo p {
    color: var(--tl-muted);
    margin: 6px 0 0;
}

.login-hint {
    margin-top: 16px;
    padding: 12px;
    border-radius: 14px;
    background: #f8f8fc;
    color: var(--tl-muted);
    font-size: 0.9rem;
    text-align: center;
}

.btn-primary {
    --bs-btn-bg: var(--tl-primary);
    --bs-btn-border-color: var(--tl-primary);
    --bs-btn-hover-bg: var(--tl-primary-dark);
    --bs-btn-hover-border-color: var(--tl-primary-dark);
}

.form-control {
    border-radius: 14px;
    border-color: var(--tl-border);
}

.form-control:focus {
    border-color: var(--tl-primary);
    box-shadow: 0 0 0 0.2rem rgba(233, 30, 99, 0.12);
}

.badge {
    border-radius: 999px;
    padding: 0.46rem 0.7rem;
}

@media (max-width: 1100px) {
    .dashboard-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 900px) {
    .tl-layout {
        grid-template-columns: 1fr;
    }

    .tl-sidebar {
        display: none;
    }

    .tl-main {
        padding: 18px;
    }

    .page-header {
        flex-direction: column;
    }
}

@media (max-width: 560px) {
    .dashboard-grid {
        grid-template-columns: 1fr;
    }

    .stat-card {
        min-height: 96px;
    }

    .login-card {
        padding: 22px;
        border-radius: 22px;
    }
}

/* SweetAlert2 Custom */
.tl-swal-popup {
    border-radius: 24px !important;
    font-family: "Google Sans", "Noto Sans Thai", sans-serif !important;
    padding: 24px !important;
}

.tl-swal-title {
    font-weight: 800 !important;
    color: var(--tl-text) !important;
}

.tl-swal-confirm,
.tl-swal-cancel {
    border-radius: 14px !important;
    padding: 10px 22px !important;
    font-weight: 700 !important;
    box-shadow: none !important;
}

.swal2-html-container,
.swal2-container {
    font-family: "Google Sans", "Noto Sans Thai", sans-serif !important;
}