/* ===================== Reset & basics ===================== */
* {
    box-sizing: border-box;
}

html, body {
    margin: 0;
    padding: 0;
    height: 100%;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background: #f4f5f7;
    color: #1f2333;
}

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

/* ===================== App layout ===================== */
.app-layout {
    display: flex;
    min-height: 100vh;
}

.content {
    flex: 1;
    overflow-y: auto;
    height: 100vh;
}

.content-inner {
    padding: 32px 40px;
    max-width: 1100px;
    margin: 0 auto;
}

.page-title {
    margin: 0 0 24px;
    font-size: 1.6rem;
    font-weight: 600;
}

/* ===================== Sidebar ===================== */
.sidebar {
    width: 60px;
    flex-shrink: 0;
    background: #1a1a2e;
    color: #e7e7f0;
    display: flex;
    flex-direction: column;
    height: 100vh;
    position: sticky;
    top: 0;
    overflow: hidden;
    transition: width 0.25s ease;
    white-space: nowrap;
    z-index: 10;
}

.sidebar:hover {
    width: 220px;
}

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 20px 18px;
    font-weight: 700;
    font-size: 1.05rem;
    color: #fff;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.sidebar-brand i {
    font-size: 1.3rem;
    width: 24px;
    text-align: center;
    flex-shrink: 0;
}

.nav-list {
    list-style: none;
    margin: 0;
    padding: 12px 0;
}

.nav-list-bottom {
    margin-top: auto;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    padding-top: 12px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 12px 18px;
    color: #c7c7d9;
    transition: background 0.15s ease, color 0.15s ease;
}

.nav-item:hover {
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
}

.nav-item.active {
    background: rgba(94, 129, 244, 0.25);
    color: #fff;
    border-left: 3px solid #5e81f4;
    padding-left: 15px;
}

.nav-icon {
    width: 24px;
    text-align: center;
    font-size: 1.1rem;
    flex-shrink: 0;
}

.nav-label {
    opacity: 0;
    transition: opacity 0.2s ease;
    white-space: nowrap;
}

.sidebar:hover .nav-label {
    opacity: 1;
}

/* ===================== Cards, forms, buttons ===================== */
.card {
    background: #fff;
    border-radius: 10px;
    padding: 24px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
    margin-bottom: 24px;
}

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

.form-group label {
    display: block;
    font-weight: 600;
    font-size: 0.9rem;
    margin-bottom: 6px;
}

.form-group input,
.form-group select {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #d7d9e3;
    border-radius: 6px;
    font-size: 0.95rem;
    background: #fff;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: #5e81f4;
    box-shadow: 0 0 0 3px rgba(94, 129, 244, 0.15);
}

.form-actions {
    display: flex;
    gap: 10px;
    margin-top: 20px;
}

.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 18px;
    border-radius: 6px;
    border: none;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s ease;
}

.btn-primary {
    background: #5e81f4;
    color: #fff;
}

.btn-primary:hover {
    background: #4a6cdb;
}

.btn-secondary {
    background: #eceef4;
    color: #1f2333;
}

.btn-secondary:hover {
    background: #dde0ec;
}

.btn-danger {
    background: #e5484d;
    color: #fff;
}

.btn-danger:hover {
    background: #c93a3f;
}

.btn-sm {
    padding: 6px 12px;
    font-size: 0.82rem;
}

/* ===================== Alerts ===================== */
.alert {
    padding: 12px 16px;
    border-radius: 6px;
    margin-bottom: 18px;
    font-size: 0.9rem;
}

.alert-error {
    background: #fdecec;
    color: #b3261e;
    border: 1px solid #f7c5c5;
}

.alert-success {
    background: #e8f6ec;
    color: #1e7a3d;
    border: 1px solid #bfe6cb;
}

/* ===================== Table ===================== */
table {
    width: 100%;
    border-collapse: collapse;
}

th, td {
    text-align: left;
    padding: 12px 10px;
    border-bottom: 1px solid #eceef4;
    font-size: 0.92rem;
}

th {
    color: #6b6f80;
    font-weight: 600;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 600;
    background: #eceef4;
    color: #444864;
}

.table-actions {
    display: flex;
    gap: 8px;
}

/* ===================== Login page ===================== */
.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #1a1a2e, #232946);
}

.login-box {
    background: #fff;
    padding: 40px;
    border-radius: 12px;
    width: 100%;
    max-width: 380px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.25);
}

.login-box h1 {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.3rem;
    margin: 0 0 24px;
}

/* ===================== Misc ===================== */
.text-muted {
    color: #6b6f80;
    font-size: 0.9rem;
}

.placeholder-box {
    text-align: center;
    padding: 60px 20px;
    color: #6b6f80;
}

.placeholder-box i {
    font-size: 2.4rem;
    margin-bottom: 16px;
    color: #b6bad0;
}

/* ===================== Mobile ===================== */
@media (max-width: 768px) {
    .sidebar {
        position: fixed;
        left: 0;
        top: 0;
        transform: translateX(-100%);
        transition: transform 0.25s ease;
        width: 220px;
    }

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

    .sidebar:hover {
        width: 220px;
    }

    .content {
        height: auto;
    }

    .mobile-topbar {
        display: flex;
        align-items: center;
        gap: 14px;
        padding: 14px 16px;
        background: #1a1a2e;
        color: #fff;
    }

    .content-inner {
        padding: 20px;
    }
}

@media (min-width: 769px) {
    .mobile-topbar {
        display: none;
    }
}
