/* ============================================
   FootballNews — Admin Panel
   ============================================ */

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

:root {
    --admin-bg: #F8F7F5;
    --admin-sidebar: #1A1A1A;
    --admin-card: #FFFFFF;
    --admin-border: #E8E5E1;
    --admin-text: #1A1A1A;
    --admin-muted: #7A7672;
    --verde: #1A7A3C;
    --verde-light: rgba(26,122,60,0.08);
    --rosso: #D0021B;
    --giallo: #E8A317;
    --blu: #2C5FD0;
    --radius: 8px;
    --shadow: 0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
}

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

body.admin-body {
    font-family: 'Inter', sans-serif;
    background: var(--admin-bg);
    color: var(--admin-text);
    display: flex;
    min-height: 100vh;
}

/* Sidebar */
.admin-sidebar {
    width: 240px;
    background: var(--admin-sidebar);
    color: white;
    padding: 24px 0;
    position: fixed;
    top: 0; bottom: 0;
    overflow-y: auto;
    z-index: 100;
}
.sidebar-logo {
    font-family: 'Oswald', sans-serif;
    font-size: 1.3rem;
    font-weight: 700;
    padding: 0 20px 24px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    margin-bottom: 16px;
}
.sidebar-logo .accent { color: var(--verde); }
.sidebar-section {
    font-size: 0.6rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: rgba(255,255,255,0.3);
    padding: 16px 20px 6px;
}
.sidebar-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 20px;
    font-size: 0.82rem;
    font-weight: 500;
    color: rgba(255,255,255,0.6);
    transition: all 0.2s;
    border-left: 3px solid transparent;
}
.sidebar-link:hover {
    color: white;
    background: rgba(255,255,255,0.05);
}
.sidebar-link.active {
    color: white;
    background: rgba(26,122,60,0.15);
    border-left-color: var(--verde);
}
.sidebar-link svg { width: 18px; height: 18px; opacity: 0.7; }

/* Main content */
.admin-main {
    margin-left: 240px;
    flex: 1;
    padding: 32px;
    min-height: 100vh;
}
.admin-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 32px;
}
.admin-header h1 {
    font-family: 'Oswald', sans-serif;
    font-size: 1.6rem;
    font-weight: 700;
    text-transform: uppercase;
}
.admin-header .user-info {
    font-size: 0.8rem;
    color: var(--admin-muted);
}

/* Cards */
.admin-card {
    background: var(--admin-card);
    border: 1px solid var(--admin-border);
    border-radius: var(--radius);
    padding: 24px;
    margin-bottom: 24px;
    box-shadow: var(--shadow);
}
.admin-card h2 {
    font-family: 'Oswald', sans-serif;
    font-size: 1.1rem;
    text-transform: uppercase;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--admin-border);
}

/* Stats grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    margin-bottom: 32px;
}
.stat-card {
    background: var(--admin-card);
    border: 1px solid var(--admin-border);
    border-radius: var(--radius);
    padding: 20px;
    box-shadow: var(--shadow);
}
.stat-card .stat-label {
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--admin-muted);
    margin-bottom: 8px;
}
.stat-card .stat-value {
    font-family: 'Oswald', sans-serif;
    font-size: 2rem;
    font-weight: 700;
    color: var(--admin-text);
}
.stat-card.green .stat-value { color: var(--verde); }
.stat-card.red .stat-value { color: var(--rosso); }
.stat-card.yellow .stat-value { color: var(--giallo); }
.stat-card.blue .stat-value { color: var(--blu); }

/* Tables */
.admin-table {
    width: 100%;
    border-collapse: collapse;
}
.admin-table th {
    text-align: left;
    font-size: 0.68rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--admin-muted);
    padding: 10px 12px;
    border-bottom: 2px solid var(--admin-border);
}
.admin-table td {
    padding: 12px;
    border-bottom: 1px solid var(--admin-border);
    font-size: 0.85rem;
    vertical-align: middle;
}
.admin-table tr:hover td {
    background: rgba(26,122,60,0.02);
}

/* Status badges */
.badge {
    display: inline-block;
    font-size: 0.65rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    padding: 3px 8px;
    border-radius: 3px;
}
.badge-bozza { background: #FFF3CD; color: #856404; }
.badge-revisione { background: #D1ECF1; color: #0C5460; }
.badge-approvato { background: #D4EDDA; color: #155724; }
.badge-pubblicato { background: var(--verde-light); color: var(--verde); }
.badge-programmato { background: #E8DAEF; color: #6C3483; }
.badge-archiviato { background: #F0F0F0; color: #666; }
.badge-pending { background: #FFF3CD; color: #856404; }
.badge-running { background: #D1ECF1; color: #0C5460; }
.badge-done { background: #D4EDDA; color: #155724; }
.badge-error { background: #F8D7DA; color: #721C24; }

/* Forms */
.form-group {
    margin-bottom: 20px;
}
.form-group label {
    display: block;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--admin-muted);
    margin-bottom: 6px;
}
.form-control {
    width: 100%;
    font-family: 'Inter', sans-serif;
    font-size: 0.88rem;
    padding: 10px 14px;
    border: 1px solid var(--admin-border);
    border-radius: 6px;
    background: white;
    color: var(--admin-text);
    transition: border-color 0.2s;
    outline: none;
}
.form-control:focus {
    border-color: var(--verde);
    box-shadow: 0 0 0 3px rgba(26,122,60,0.1);
}
textarea.form-control {
    min-height: 200px;
    resize: vertical;
    font-family: 'Inter', sans-serif;
}
select.form-control {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg width='10' height='6' viewBox='0 0 10 6' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%237A7672' fill='none' stroke-width='1.5'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
    padding-right: 36px;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-family: 'Inter', sans-serif;
    font-size: 0.78rem;
    font-weight: 600;
    padding: 10px 20px;
    border-radius: 6px;
    border: none;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
}
.btn-primary {
    background: var(--verde);
    color: white;
}
.btn-primary:hover { background: #14602F; }
.btn-secondary {
    background: var(--admin-bg);
    color: var(--admin-text);
    border: 1px solid var(--admin-border);
}
.btn-secondary:hover { background: var(--admin-border); }
.btn-danger {
    background: var(--rosso);
    color: white;
}
.btn-danger:hover { background: #A80216; }
.btn-small {
    font-size: 0.7rem;
    padding: 6px 12px;
}
.btn-group { display: flex; gap: 8px; }

/* Grid */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
.grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 24px; }

/* Agente cards */
.agente-card {
    background: var(--admin-card);
    border: 1px solid var(--admin-border);
    border-radius: var(--radius);
    padding: 20px;
    cursor: pointer;
    transition: all 0.2s;
    text-align: center;
}
.agente-card:hover, .agente-card.selected {
    border-color: var(--verde);
    box-shadow: 0 0 0 3px rgba(26,122,60,0.1);
}
.agente-card .agente-emoji { font-size: 2rem; margin-bottom: 8px; }
.agente-card .agente-name {
    font-weight: 600;
    font-size: 0.85rem;
    text-transform: uppercase;
}

/* Alert */
.alert {
    padding: 14px 18px;
    border-radius: var(--radius);
    font-size: 0.85rem;
    margin-bottom: 20px;
}
.alert-success { background: #D4EDDA; color: #155724; border: 1px solid #C3E6CB; }
.alert-error { background: #F8D7DA; color: #721C24; border: 1px solid #F5C6CB; }

/* Login */
.login-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background: var(--admin-sidebar);
}
.login-card {
    background: white;
    border-radius: 12px;
    padding: 48px 40px;
    width: 100%;
    max-width: 400px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}
.login-card .logo {
    font-family: 'Oswald', sans-serif;
    font-size: 1.8rem;
    text-align: center;
    margin-bottom: 32px;
    color: var(--admin-text);
}
.login-card .logo .accent { color: var(--verde); }
.login-card .btn-primary {
    width: 100%;
    justify-content: center;
    padding: 12px;
    font-size: 0.85rem;
}

/* Responsive admin */
@media (max-width: 1024px) {
    .stats-grid { grid-template-columns: repeat(2, 1fr); }
    .grid-3 { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 768px) {
    .admin-sidebar { width: 60px; padding: 16px 0; }
    .sidebar-logo, .sidebar-section { display: none; }
    .sidebar-link { padding: 12px; justify-content: center; }
    .sidebar-link span { display: none; }
    .admin-main { margin-left: 60px; padding: 16px; }
    .stats-grid { grid-template-columns: 1fr; }
    .grid-2, .grid-3 { grid-template-columns: 1fr; }
}
