* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary: #2563eb;
    --primary-dark: #1d4ed8;
    --primary-light: #dbeafe;
    --white: #ffffff;
    --text: #0f172a;
    --muted: #64748b;
    --border: #dbe2ea;
    --danger-bg: #fee2e2;
    --danger-text: #991b1b;
    --success-bg: #dcfce7;
    --success-text: #166534;
    --sidebar-bg: #0f172a;
    --sidebar-text: #e2e8f0;
    --sidebar-hover: rgba(255,255,255,0.08);
    --shadow-main: 0 24px 60px rgba(15, 23, 42, 0.12);
    --shadow-card: 0 18px 45px rgba(15, 23, 42, 0.10);
    --shadow-soft: 0 10px 24px rgba(15, 23, 42, 0.08);
}

html,
body {
    min-height: 100%;
}

body {
    font-family: Arial, sans-serif;
    color: var(--text);
    background:
        radial-gradient(circle at 12% 10%, rgba(37, 99, 235, 0.10), transparent 24%),
        radial-gradient(circle at 88% 16%, rgba(29, 78, 216, 0.08), transparent 22%),
        radial-gradient(circle at 78% 84%, rgba(37, 99, 235, 0.06), transparent 18%),
        linear-gradient(135deg, #f8fbff 0%, #eef4ff 46%, #f9fbff 100%);
    line-height: 1.5;
    overflow-x: hidden;
}

a {
    text-decoration: none;
    color: inherit;
}

img {
    max-width: 100%;
    display: block;
}

/* alerts */
.alert {
    padding: 12px 14px;
    border-radius: 14px;
    margin-bottom: 16px;
    font-size: 14px;
    border: 1px solid transparent;
}

.alert-danger {
    background: var(--danger-bg);
    color: var(--danger-text);
    border-color: #fecaca;
}

.alert-success {
    background: var(--success-bg);
    color: var(--success-text);
    border-color: #bbf7d0;
}

/* =========================
   LOGIN PAGE
========================= */
.login-page {
    min-height: calc(100vh - 52px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px 18px 14px;
}

.login-shell {
    width: 100%;
    max-width: 1120px;
    display: grid;
    grid-template-columns: minmax(420px, 620px) 420px;
    justify-content: center;
    gap: 26px;
    align-items: center;
}

.login-branding {
    position: relative;
    overflow: hidden;
    border-radius: 28px;
    background:
        linear-gradient(145deg, #08152f 0%, #173d92 52%, #2563eb 100%);
    color: #ffffff;
    box-shadow: var(--shadow-main);
}

.login-branding::before {
    content: "";
    position: absolute;
    width: 190px;
    height: 190px;
    border-radius: 50%;
    top: -70px;
    right: -60px;
    background: rgba(255, 255, 255, 0.08);
}

.login-branding::after {
    content: "";
    position: absolute;
    width: 210px;
    height: 210px;
    border-radius: 50%;
    bottom: -90px;
    left: -70px;
    background: rgba(255, 255, 255, 0.07);
}

.brand-content {
    position: relative;
    z-index: 2;
    padding: 42px 40px;
    min-height: 430px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.brand-logo-wrap {
    margin-bottom: 20px;
}

.brand-logo {
    height: 100px;
    max-width: 320px;
    object-fit: contain;
    background: rgba(255, 255, 255, 0.98);
    padding: 10px 14px;
    border-radius: 18px;
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.12);
}

.brand-logo-placeholder {
    width: 88px;
    height: 88px;
    border-radius: 22px;
    background: rgba(255, 255, 255, 0.16);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    font-weight: 800;
    margin-bottom: 20px;
    letter-spacing: 0.5px;
}

.brand-tag {
    display: inline-flex;
    align-items: center;
    width: fit-content;
    padding: 7px 12px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.12);
    color: #dbeafe;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.3px;
    margin-bottom: 14px;
    border: 1px solid rgba(255, 255, 255, 0.10);
}

.brand-title {
    font-size: 34px;
    line-height: 1.18;
    font-weight: 800;
    max-width: 560px;
    margin-bottom: 14px;
    word-break: break-word;
    letter-spacing: 0.2px;
}

.brand-text {
    max-width: 520px;
    font-size: 16px;
    line-height: 1.8;
    color: rgba(255, 255, 255, 0.93);
}

.brand-feature-box {
    margin-top: 20px;
    display: grid;
    gap: 10px;
    max-width: 350px;
}

.feature-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.10);
    border: 1px solid rgba(255, 255, 255, 0.10);
    backdrop-filter: blur(4px);
    font-size: 13px;
    font-weight: 600;
}

.feature-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #93c5fd;
    flex-shrink: 0;
}

.login-form-side {
    display: flex;
    align-items: center;
    justify-content: center;
}

.login-form-card {
    width: 100%;
    max-width: 420px;
    padding: 30px 24px 22px;
    border-radius: 26px;
    background: rgba(255, 255, 255, 0.78);
    border: 1px solid rgba(255, 255, 255, 0.78);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    box-shadow:
        0 24px 52px rgba(15, 23, 42, 0.10),
        inset 0 1px 0 rgba(255, 255, 255, 0.55);
}

.login-form-header {
    text-align: center;
    margin-bottom: 20px;
}

.login-form-header h2 {
    font-size: 38px;
    line-height: 1.08;
    margin-bottom: 8px;
    color: #0f172a;
    font-weight: 800;
}

.login-form-header p {
    font-size: 15px;
    color: var(--muted);
}

.form-group {
    margin-bottom: 15px;
}

.form-group label {
    display: block;
    margin-bottom: 7px;
    font-size: 14px;
    font-weight: 700;
    color: var(--text);
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    height: 50px;
    padding: 0 16px;
    border-radius: 14px;
    border: 1px solid var(--border);
    background: rgba(255, 255, 255, 0.96);
    outline: none;
    font-size: 15px;
    color: var(--text);
    transition: all 0.2s ease;
    box-shadow: inset 0 1px 2px rgba(15, 23, 42, 0.02);
}

.form-group textarea {
    min-height: 110px;
    padding: 14px 16px;
    resize: vertical;
}

.form-group input::placeholder,
.form-group textarea::placeholder {
    color: #94a3b8;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    border-color: var(--primary);
    box-shadow:
        0 0 0 4px rgba(37, 99, 235, 0.10),
        inset 0 1px 2px rgba(15, 23, 42, 0.02);
}

.login-btn {
    width: 100%;
    height: 52px;
    border: none;
    border-radius: 15px;
    background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
    color: #ffffff;
    font-size: 17px;
    font-weight: 700;
    cursor: pointer;
    margin-top: 6px;
    box-shadow: 0 14px 28px rgba(37, 99, 235, 0.22);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.login-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 16px 30px rgba(37, 99, 235, 0.28);
}

.demo-box {
    margin-top: 18px;
    padding: 14px 15px;
    border-radius: 16px;
    background: linear-gradient(180deg, #f8fbff, #f2f7ff);
    border: 1px solid #e4ecfb;
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.6);
}

.demo-box h4 {
    font-size: 17px;
    margin-bottom: 8px;
    color: #0f172a;
}

.demo-box p {
    margin: 4px 0;
    font-size: 14px;
    color: #334155;
}

.login-footer {
    text-align: center;
    padding: 8px 12px 14px;
    color: #64748b;
    font-size: 13px;
    background: transparent;
}

/* =========================
   ADMIN LAYOUT
========================= */
.topbar {
    position: sticky;
    top: 0;
    z-index: 1000;
    min-height: 68px;
    background: rgba(255, 255, 255, 0.82);
    border-bottom: 1px solid rgba(219, 226, 234, 0.8);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 22px;
}

.topbar-left,
.topbar-right {
    display: flex;
    align-items: center;
    gap: 14px;
    flex-wrap: wrap;
}

.topbar-title {
    font-size: 20px;
    font-weight: 800;
    color: #0f172a;
}

.topbar-link {
    padding: 9px 14px;
    border-radius: 12px;
    background: rgba(37, 99, 235, 0.08);
    color: #1d4ed8;
    font-weight: 700;
    font-size: 14px;
}

.user-badge {
    padding: 9px 14px;
    border-radius: 999px;
    background: #eef4ff;
    color: #1d4ed8;
    font-size: 14px;
    font-weight: 700;
}

.admin-layout {
    display: flex;
    min-height: calc(100vh - 68px);
}

.sidebar {
    width: 270px;
    background: linear-gradient(180deg, #0f172a 0%, #111c35 100%);
    color: var(--sidebar-text);
    padding: 22px 16px;
    border-right: 1px solid rgba(255,255,255,0.04);
    box-shadow: 8px 0 24px rgba(15, 23, 42, 0.06);
}

.sidebar-head {
    padding: 10px 10px 18px;
    margin-bottom: 14px;
    border-bottom: 1px solid rgba(255,255,255,0.08);
}

.sidebar-head h3 {
    font-size: 24px;
    font-weight: 800;
    color: #ffffff;
    margin-bottom: 4px;
}

.sidebar-head p {
    font-size: 13px;
    color: rgba(226,232,240,0.72);
}

.sidebar-menu {
    list-style: none;
}

.sidebar-menu li {
    margin-bottom: 8px;
}

.sidebar-link {
    display: block;
    padding: 12px 14px;
    border-radius: 14px;
    color: var(--sidebar-text);
    font-weight: 700;
    font-size: 15px;
    transition: 0.2s ease;
}

.sidebar-link:hover,
.sidebar-link.active {
    background: var(--sidebar-hover);
    color: #ffffff;
}

.logout-link {
    color: #fecaca;
    background: rgba(239, 68, 68, 0.10);
}

.admin-content {
    flex: 1;
    padding: 28px;
}

.content-header {
    margin-bottom: 22px;
}

.content-header h1 {
    font-size: 38px;
    line-height: 1.12;
    margin-bottom: 8px;
    color: #0f172a;
    font-weight: 800;
}

.content-header p {
    color: var(--muted);
    font-size: 16px;
}

.profile-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    margin-bottom: 22px;
}

.profile-card,
.panel-card,
.stat-card {
    background: rgba(255,255,255,0.82);
    border: 1px solid rgba(255,255,255,0.74);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-radius: 22px;
    box-shadow: var(--shadow-soft);
    padding: 20px;
}

.profile-label {
    font-size: 13px;
    color: var(--muted);
    margin-bottom: 6px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.4px;
}

.profile-value {
    font-size: 18px;
    font-weight: 800;
    color: #0f172a;
    word-break: break-word;
}

.panel-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 18px;
}

.panel-card h2 {
    font-size: 20px;
    margin-bottom: 10px;
    color: #0f172a;
}

.panel-card p {
    color: #475569;
    font-size: 15px;
    line-height: 1.75;
}

.quick-links {
    margin-top: 14px;
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.quick-link {
    padding: 10px 14px;
    border-radius: 12px;
    background: #eef4ff;
    color: #1d4ed8;
    font-size: 14px;
    font-weight: 700;
}

.table-responsive {
    width: 100%;
    overflow-x: auto;
}

.data-table {
    width: 100%;
    min-width: 760px;
    border-collapse: separate;
    border-spacing: 0;
    background: #ffffff;
    border: 1px solid #dbe2ea;
    border-radius: 16px;
    overflow: hidden;
}

.data-table thead th {
    background: #f3f6fb;
    color: #111827;
    font-size: 14px;
    font-weight: 700;
    padding: 13px 12px;
    text-align: left;
    border-bottom: 1px solid #dbe2ea;
}

.data-table tbody td {
    padding: 13px 12px;
    border-bottom: 1px solid #e5e7eb;
    color: #111827;
    vertical-align: middle;
}

.data-table tbody tr:nth-child(even) {
    background: #fafcff;
}

.data-table tbody tr:hover {
    background: #eef4ff;
}

.data-table tbody tr:last-child td {
    border-bottom: none;
}

/* =========================
   RESPONSIVE
========================= */
@media (max-width: 1100px) {
    .login-shell {
        max-width: 760px;
        grid-template-columns: 1fr;
        gap: 18px;
    }

    .brand-content {
        min-height: auto;
        padding: 32px 24px;
    }

    .brand-title {
        font-size: 30px;
    }

    .brand-text {
        font-size: 15px;
    }

    .login-form-card {
        max-width: 100%;
    }

    .profile-grid,
    .panel-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 900px) {
    .admin-layout {
        flex-direction: column;
    }

    .sidebar {
        width: 100%;
        border-right: none;
        border-bottom: 1px solid rgba(255,255,255,0.05);
    }

    .admin-content {
        padding: 20px 16px;
    }

    .topbar {
        padding: 0 14px;
    }
}

@media (max-width: 768px) {
    .login-page {
        padding: 10px 10px 10px;
        min-height: auto;
    }

    .login-shell {
        gap: 14px;
        grid-template-columns: 1fr;
    }

    .login-branding {
        border-radius: 22px;
    }

    .brand-content {
        padding: 22px 16px;
        min-height: auto;
    }

    .brand-logo {
        height: 74px;
        max-width: 230px;
    }

    .brand-logo-placeholder {
        width: 68px;
        height: 68px;
        font-size: 22px;
    }

    .brand-title {
        font-size: 24px;
    }

    .brand-text {
        font-size: 14px;
        line-height: 1.72;
    }

    .brand-feature-box {
        margin-top: 16px;
        gap: 9px;
    }

    .feature-item {
        font-size: 12px;
        padding: 9px 11px;
    }

    .login-form-card {
        padding: 22px 16px 18px;
        border-radius: 22px;
    }

    .login-form-header h2 {
        font-size: 30px;
    }

    .login-form-header p {
        font-size: 14px;
    }

    .form-group input,
    .form-group select,
    .form-group textarea {
        height: 48px;
        font-size: 14px;
    }

    .form-group textarea {
        min-height: 100px;
    }

    .login-btn {
        height: 50px;
        font-size: 15px;
    }

    .demo-box h4 {
        font-size: 16px;
    }

    .demo-box p {
        font-size: 13px;
    }

    .content-header h1 {
        font-size: 30px;
    }

    .topbar-title {
        font-size: 18px;
    }
}