/* ============================================================
   Easy CMS — Admin stylesheet
   Used by all admin pages
   ============================================================ */

*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html, body {
    min-height: 100%;
    font-family: 'DM Sans', sans-serif;
    background: #f0f2f5;
    color: #2c3e50;
    font-size: 16px;
    line-height: 1.5;
}

/* ─── Layout shell ───────────────────────────────────────────── */

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

.admin-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
    margin-left: 240px;
    transition: margin-left 0.25s ease;
}

.admin-main.sidebar-collapsed {
    margin-left: 0;
}

.admin-content {
    flex: 1;
    padding: 28px 32px;
}

/* ─── Topbar ─────────────────────────────────────────────────── */

.admin-topbar {
    position: sticky;
    top: 0;
    z-index: 100;
    background: #1e252e;
    color: #ffffff;
    height: 54px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.18);
}

.sidebar-toggle {
    background: none;
    border: none;
    color: #ffffff;
    font-size: 1.1rem;
    cursor: pointer;
    padding: 6px 10px;
    border-radius: 5px;
    transition: background 0.2s;
    line-height: 1;
}

.sidebar-toggle:hover {
    background: rgba(255,255,255,0.1);
}

.sidebar-toggle-icon {
    display: inline-block;
    transition: transform 0.25s ease;
}

.sidebar-collapsed .sidebar-toggle-icon,
.admin-main.sidebar-collapsed ~ * .sidebar-toggle-icon {
    transform: rotate(180deg);
}

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

.topbar-link {
    color: #a8c4e0;
    text-decoration: none;
    font-size: 0.875rem;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: color 0.2s;
}

.topbar-link:hover {
    color: #ffffff;
}

.topbar-logout {
    padding: 7px 16px;
    background: #c0392b;
    color: #ffffff;
    border: none;
    border-radius: 6px;
    font-size: 0.875rem;
    font-family: inherit;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    text-decoration: none;
}

.topbar-logout:hover {
    background: #a93226;
    color: #ffffff;
}

/* ─── Sidebar ────────────────────────────────────────────────── */

.admin-sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: 240px;
    height: 100vh;
    background: #1e252e;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    z-index: 200;
    transition: transform 0.25s ease;
    scrollbar-width: thin;
    scrollbar-color: #3a4a5a #1e252e;
}

.admin-sidebar.hidden {
    transform: translateX(-240px);
}

.sidebar-logo {
    padding: 20px 20px 14px;
    border-bottom: 1px solid rgba(255,255,255,0.08);
    text-align: center;
}

.sidebar-logo img {
    width: 100px;
    height: auto;

}

/* ─── Nav groups (dropdowns) ─────────────────────────────────── */

.nav-group {
    border-bottom: 1px solid rgba(255,255,255,0.06);
}

.nav-group-toggle {
    width: 100%;
    background: none;
    border: none;
    color: #a8bfcf;
    font-family: inherit;
    font-size: 0.875rem;
    font-weight: 600;
    padding: 12px 18px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
    transition: color 0.2s, background 0.2s;
    text-align: left;
}

.nav-group-toggle:hover {
    color: #ffffff;
    background: rgba(255,255,255,0.04);
}

.nav-group-toggle span {
    display: flex;
    align-items: center;
    gap: 8px;
}

.nav-group-icon {
    font-size: 0.8rem;
    opacity: 0.7;
}

.chevron {
    font-size: 0.7rem;
    transition: transform 0.25s ease;
    opacity: 0.6;
}

.nav-group.open .chevron {
    transform: rotate(180deg);
}

.nav-group-items {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
}

.nav-group.open .nav-group-items {
    max-height: 600px;
}

.nav-link {
    display: block;
    padding: 8px 18px 8px 28px;
    color: #8a9faf;
    text-decoration: none;
    font-size: 0.875rem;
    border-left: 3px solid transparent;
    transition: background 0.15s, color 0.15s, border-color 0.15s;
}

.nav-link:hover {
    background: rgba(255,255,255,0.06);
    color: #ffffff;
}

.nav-link.active {
    background: rgba(45,137,239,0.15);
    color: #ffffff;
    border-left-color: #2d89ef;
    font-weight: 500;
}

.sidebar-bottom {
    margin-top: auto;
}

.sidebar-version {
    text-align: center;
    font-size: 0.72rem;
    color: #8a9faf;
    padding: 8px 18px;
    letter-spacing: 0.04em;
}

.sidebar-support {
    margin-top: auto;
    padding: 16px 18px;
    border-top: 1px solid rgba(255,255,255,0.08);
}

.support-btn {
    display: block;
    width: 100%;
    padding: 9px 14px;
    background: rgba(255,255,255,0.07);
    color: #a8bfcf;
    border: 1px solid rgba(255,255,255,0.15);
    border-radius: 6px;
    font-size: 0.875rem;
    text-align: center;
    text-decoration: none;
    transition: background 0.2s, color 0.2s;
}

.support-btn:hover {
    background: rgba(255,255,255,0.12);
    color: #ffffff;
}

.sidebar-legal {
    margin-top: 10px;
    text-align: center;
}

.sidebar-legal-link {
    font-size: 0.75rem;
    color: #5a6a7a;
    text-decoration: none;
    transition: color 0.2s;
}

.sidebar-legal-link:hover {
    color: #a8bfcf;
}

.sidebar-legal-sep {
    font-size: 0.75rem;
    color: #5a6a7a;
    margin: 0 5px;
}

/* ─── Page heading ───────────────────────────────────────────── */

.page-heading {
    margin-bottom: 24px;
}

.page-heading h1 {
    font-size: 1.5rem;
    font-weight: 600;
    color: #1e252e;
}

.page-heading p {
    font-size: 0.9rem;
    color: #5a6a7a;
    margin-top: 4px;
}

/* ─── Cards ──────────────────────────────────────────────────── */

.card {
    background: #ffffff;
    border-radius: 10px;
    box-shadow: 0 2px 12px rgba(30,37,46,0.08);
    padding: 24px 28px;
    margin-bottom: 24px;
}

.card-title {
    font-size: 1rem;
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid #eef0f3;
}

/* ─── Alerts ─────────────────────────────────────────────────── */

.alert {
    padding: 11px 14px;
    border-radius: 7px;
    font-size: 0.9rem;
    line-height: 1.45;
    margin-bottom: 20px;
    display: flex;
    align-items: flex-start;
    gap: 9px;
}

.alert i { flex-shrink: 0; margin-top: 2px; }

.alert-error   { background: #fff0f0; border: 1px solid #f5c6c6; color: #b94040; }
.alert-success { background: #f0faf3; border: 1px solid #b7dfbf; color: #2d6a3f; }
.alert-info    { background: #fffbe6; border: 1px solid #f0d080; color: #7a5c00; }

/* ─── Buttons ────────────────────────────────────────────────── */

.btn-primary {
    padding: 10px 20px;
    background: #2d89ef;
    color: #ffffff;
    border: none;
    border-radius: 7px;
    font-size: 0.95rem;
    font-family: inherit;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 7px;
}

.btn-primary:hover { background: #1b6fd3; }

.btn-secondary {
    padding: 9px 18px;
    background: #ffffff;
    color: #2c3e50;
    border: 1px solid #dde3ea;
    border-radius: 7px;
    font-size: 0.9rem;
    font-family: inherit;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s, border-color 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 7px;
}

.btn-secondary:hover { background: #f0f2f5; border-color: #b0bec5; }

.btn-danger {
    padding: 9px 18px;
    background: #ffffff;
    color: #b94040;
    border: 1px solid #f5c6c6;
    border-radius: 7px;
    font-size: 0.9rem;
    font-family: inherit;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 7px;
}

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

/* ─── Forms ──────────────────────────────────────────────────── */

.field { margin-bottom: 18px; }

.field-label {
    display: block;
    font-size: 0.82rem;
    font-weight: 600;
    color: #5a6a7a;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-bottom: 6px;
}

.field-hint {
    font-size: 0.8rem;
    color: #5a6a7a;
    margin-top: 4px;
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="url"],
textarea,
select {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #dde3ea;
    border-radius: 7px;
    font-size: 0.95rem;
    font-family: inherit;
    color: #2c3e50;
    background: #fafbfc;
    transition: border-color 0.2s, box-shadow 0.2s;
    -webkit-appearance: none;
}

input[type="text"]:focus,
input[type="email"]:focus,
input[type="password"]:focus,
input[type="url"]:focus,
textarea:focus,
select:focus {
    outline: none;
    border-color: #2d89ef;
    box-shadow: 0 0 0 3px rgba(45,137,239,0.12);
    background: #ffffff;
}

textarea { resize: vertical; min-height: 100px; }

/* ─── Tables ─────────────────────────────────────────────────── */

.table-wrap { overflow-x: auto; }

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

th {
    text-align: left;
    padding: 10px 12px;
    font-size: 0.78rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #5a6a7a;
    border-bottom: 2px solid #eef0f3;
}

td {
    padding: 11px 12px;
    border-bottom: 1px solid #f0f2f5;
    color: #2c3e50;
    vertical-align: middle;
}

tr:last-child td { border-bottom: none; }
tr:hover td { background: #f8f9fb; }

/* ─── Responsive ─────────────────────────────────────────────── */

@media (max-width: 768px) {
    .admin-sidebar {
        transform: translateX(-240px);
    }

    .admin-sidebar.visible {
        transform: translateX(0);
        box-shadow: 4px 0 20px rgba(0,0,0,0.3);
    }

    .admin-main {
        margin-left: 0;
    }

    .admin-content {
        padding: 20px 16px;
    }
}
