/* ==========================================================================
   Admin Panel Styles
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Lato:wght@300;400;700&display=swap');

:root {
    --admin-bg: #f4f5f7;
    --admin-sidebar: #1a1a2e;
    --admin-card: #ffffff;
    --admin-border: #e2e4e8;
    --admin-primary: #2b4c7e;
    --admin-primary-hover: #1e3a5f;
    --admin-text: #2c3e50;
    --admin-muted: #7f8c8d;
    --admin-success: #27ae60;
    --admin-danger: #e74c3c;
    --admin-warning: #f39c12;
    --admin-gold: #c9a84c;
}

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

body {
    font-family: 'Lato', sans-serif;
    background: var(--admin-bg);
    color: var(--admin-text);
    line-height: 1.6;
}

/* Layout */
.admin-layout {
    display: grid;
    grid-template-columns: 240px 1fr;
    min-height: 100vh;
}

/* Sidebar */
.sidebar {
    background: var(--admin-sidebar);
    padding: 1.5rem 0;
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto;
}

.sidebar__brand {
    padding: 0 1.2rem 1.5rem;
    border-bottom: 1px solid rgba(255,255,255,0.08);
    margin-bottom: 1rem;
}

.sidebar__brand h2 {
    color: var(--admin-gold);
    font-size: 1rem;
    font-weight: 700;
    letter-spacing: 0.08em;
}

.sidebar__brand small {
    color: rgba(255,255,255,0.4);
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

.sidebar nav a {
    display: flex;
    align-items: center;
    gap: 0.7em;
    padding: 0.7rem 1.2rem;
    color: rgba(255,255,255,0.6);
    text-decoration: none;
    font-size: 0.88rem;
    transition: all 0.2s;
    border-left: 3px solid transparent;
}

.sidebar nav a:hover,
.sidebar nav a.active {
    color: #fff;
    background: rgba(255,255,255,0.06);
    border-left-color: var(--admin-gold);
}

.sidebar nav a .icon {
    font-size: 1.1rem;
    width: 1.4em;
    text-align: center;
}

.sidebar__footer {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 1rem 1.2rem;
    border-top: 1px solid rgba(255,255,255,0.08);
}

.sidebar__footer a {
    color: rgba(255,255,255,0.4);
    text-decoration: none;
    font-size: 0.8rem;
}

.sidebar__footer a:hover {
    color: var(--admin-gold);
}

/* Main Area */
.admin-main {
    padding: 2rem;
    max-width: 1100px;
}

.admin-main h1 {
    font-size: 1.6rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
    color: var(--admin-text);
}

/* Cards */
.card {
    background: var(--admin-card);
    border: 1px solid var(--admin-border);
    border-radius: 6px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

.card h2 {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 1rem;
    padding-bottom: 0.7rem;
    border-bottom: 1px solid var(--admin-border);
}

/* Stats */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.stat-card {
    background: var(--admin-card);
    border: 1px solid var(--admin-border);
    border-radius: 6px;
    padding: 1.2rem;
    text-align: center;
}

.stat-card .stat-number {
    font-size: 2rem;
    font-weight: 700;
    color: var(--admin-primary);
}

.stat-card .stat-label {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--admin-muted);
}

/* Forms */
.form-group {
    margin-bottom: 1.2rem;
}

.form-group label {
    display: block;
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--admin-muted);
    margin-bottom: 0.3rem;
}

.form-group input[type="text"],
.form-group input[type="email"],
.form-group input[type="password"],
.form-group input[type="url"],
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 0.6rem 0.8rem;
    border: 1px solid var(--admin-border);
    border-radius: 4px;
    font-family: 'Lato', sans-serif;
    font-size: 0.9rem;
    color: var(--admin-text);
    transition: border-color 0.3s;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--admin-primary);
    box-shadow: 0 0 0 3px rgba(43,76,126,0.1);
}

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

.form-group .help-text {
    font-size: 0.75rem;
    color: var(--admin-muted);
    margin-top: 0.3rem;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.4em;
    padding: 0.6rem 1.2rem;
    font-size: 0.85rem;
    font-weight: 700;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.2s;
    font-family: 'Lato', sans-serif;
}

.btn-primary {
    background: var(--admin-primary);
    color: #fff;
}
.btn-primary:hover {
    background: var(--admin-primary-hover);
    color: #fff;
}

.btn-success {
    background: var(--admin-success);
    color: #fff;
}
.btn-success:hover { background: #219a52; color: #fff; }

.btn-danger {
    background: var(--admin-danger);
    color: #fff;
}
.btn-danger:hover { background: #c0392b; color: #fff; }

.btn-sm {
    padding: 0.3rem 0.7rem;
    font-size: 0.75rem;
}

.btn-outline {
    background: transparent;
    border: 1px solid var(--admin-border);
    color: var(--admin-text);
}
.btn-outline:hover {
    background: var(--admin-bg);
}

/* Tables */
.table-wrapper {
    overflow-x: auto;
}

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

table th {
    text-align: left;
    padding: 0.7rem 0.8rem;
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--admin-muted);
    border-bottom: 2px solid var(--admin-border);
    white-space: nowrap;
}

table td {
    padding: 0.7rem 0.8rem;
    border-bottom: 1px solid var(--admin-border);
    vertical-align: top;
}

table tr:hover td {
    background: rgba(0,0,0,0.015);
}

.badge {
    display: inline-block;
    padding: 0.15em 0.6em;
    border-radius: 3px;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.badge-visible { background: #d4edda; color: var(--admin-success); }
.badge-hidden { background: #f8d7da; color: var(--admin-danger); }
.badge-active { background: #d4edda; color: var(--admin-success); }
.badge-inactive { background: #e2e4e8; color: var(--admin-muted); }

/* Flash Messages */
.flash {
    padding: 0.8rem 1.2rem;
    border-radius: 4px;
    margin-bottom: 1.2rem;
    font-size: 0.9rem;
}

.flash--success { background: #d4edda; color: #155724; border: 1px solid #b7dfbf; }
.flash--error { background: #f8d7da; color: #721c24; border: 1px solid #f1aeb5; }

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

.login-box {
    background: #fff;
    border-radius: 8px;
    padding: 2.5rem;
    width: 100%;
    max-width: 380px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}

.login-box h1 {
    font-size: 1.2rem;
    text-align: center;
    margin-bottom: 0.3rem;
}

.login-box .login-subtitle {
    text-align: center;
    color: var(--admin-muted);
    font-size: 0.8rem;
    margin-bottom: 1.5rem;
}

.login-box .btn-primary {
    width: 100%;
    padding: 0.8rem;
    justify-content: center;
}

/* Responsive */
@media (max-width: 768px) {
    .admin-layout {
        grid-template-columns: 1fr;
    }
    .sidebar {
        position: relative;
        height: auto;
    }
    .sidebar__footer {
        position: relative;
    }
}

/* Truncate text */
.truncate {
    max-width: 300px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.text-right { text-align: right; }
.text-center { text-align: center; }
.mt-1 { margin-top: 1rem; }
.mb-1 { margin-bottom: 1rem; }
.flex-end { display: flex; justify-content: flex-end; gap: 0.5rem; }
