/* ============================================================
   Pizza e Pane - Standalone Admin CSS
   ============================================================ */

:root {
    --admin-primary: #c2410c;
    --admin-primary-hover: #9a3412;
    --admin-dark: #1e293b;
    --admin-bg: #f8fafc;
    --admin-card: #ffffff;
    --admin-border: #e2e8f0;
    --admin-text: #334155;
    --admin-success: #16a34a;
    --admin-danger: #dc2626;
    --admin-warning: #d97706;
}

body.admin-body {
    font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background-color: var(--admin-bg);
    color: var(--admin-text);
    line-height: 1.5;
    min-height: 100vh;
}

.admin-header {
    background: #ffffff;
    border-bottom: 1px solid var(--admin-border);
    padding: 12px 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 100;
}

.admin-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 700;
    font-size: 1.15rem;
    color: var(--admin-dark);
}

.admin-brand img {
    width: 28px;
    height: 28px;
}

.admin-nav {
    display: flex;
    gap: 16px;
    align-items: center;
}

.admin-nav a {
    color: var(--admin-text);
    font-size: 0.9rem;
    font-weight: 500;
    padding: 6px 12px;
    border-radius: 6px;
    text-decoration: none;
}

.admin-nav a:hover, .admin-nav a.active {
    background: #f1f5f9;
    color: var(--admin-primary);
}

.admin-main {
    max-width: 1200px;
    margin: 24px auto;
    padding: 0 20px 48px;
}

.admin-card {
    background: #ffffff;
    border: 1px solid var(--admin-border);
    border-radius: 12px;
    padding: 24px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.04);
    margin-bottom: 24px;
}

.admin-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 20px;
    margin-bottom: 24px;
}

.stat-box {
    background: #ffffff;
    border: 1px solid var(--admin-border);
    border-radius: 12px;
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 16px;
}

.stat-icon {
    font-size: 2.2rem;
    width: 52px;
    height: 52px;
    background: #fff7ed;
    color: var(--admin-primary);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.stat-val {
    font-size: 1.7rem;
    font-weight: 800;
    color: var(--admin-dark);
}

.stat-lbl {
    font-size: 0.85rem;
    color: #64748b;
}

/* Forms */
.form-group {
    margin-bottom: 18px;
}

.form-label {
    display: block;
    font-weight: 600;
    font-size: 0.9rem;
    margin-bottom: 6px;
    color: var(--admin-dark);
}

.form-control {
    width: 100%;
    padding: 9px 13px;
    border: 1px solid var(--admin-border);
    border-radius: 6px;
    font-size: 0.95rem;
    background: #ffffff;
    font-family: inherit;
    box-sizing: border-box;
}

.form-control:focus {
    outline: none;
    border-color: var(--admin-primary);
    box-shadow: 0 0 0 3px rgba(194, 65, 12, 0.15);
}

textarea.form-control {
    resize: vertical;
    min-height: 120px;
    line-height: 1.5;
}

.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
}

/* Tables */
.admin-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 12px;
}

.admin-table th, .admin-table td {
    padding: 12px 14px;
    text-align: left;
    border-bottom: 1px solid var(--admin-border);
    font-size: 0.92rem;
}

.admin-table th {
    background: #f8fafc;
    font-weight: 600;
    color: #475569;
}

.admin-table tr:hover td {
    background: #fdfdfd;
}

.status-badge {
    padding: 3px 8px;
    border-radius: 12px;
    font-size: 0.78rem;
    font-weight: 600;
}

.status-published {
    background: #dcfce7;
    color: #15803d;
}

.status-draft {
    background: #f1f5f9;
    color: #64748b;
}

/* Media Grid */
.media-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 16px;
    margin-top: 16px;
}

.media-item {
    background: #ffffff;
    border: 1px solid var(--admin-border);
    border-radius: 8px;
    overflow: hidden;
    text-align: center;
    position: relative;
    padding-bottom: 8px;
}

.media-thumb {
    aspect-ratio: 1;
    width: 100%;
    object-fit: cover;
    background: #f1f5f9;
}

.media-name {
    font-size: 0.75rem;
    padding: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: #475569;
}

.btn-sm {
    padding: 4px 8px;
    font-size: 0.8rem;
    border-radius: 4px;
}

.alert {
    padding: 12px 16px;
    border-radius: 8px;
    margin-bottom: 20px;
    font-size: 0.92rem;
}

.alert-success { background: #dcfce7; color: #166534; border: 1px solid #bbf7d0; }
.alert-error { background: #fee2e2; color: #991b1b; border: 1px solid #fecaca; }

/* Login Box */
.login-box {
    max-width: 420px;
    margin: 80px auto;
    background: #ffffff;
    border: 1px solid var(--admin-border);
    border-radius: 16px;
    padding: 36px 32px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.06);
}

.login-logo {
    text-align: center;
    margin-bottom: 24px;
}

.login-logo img {
    width: 60px;
    height: 60px;
}

/* ============================================================
   Statistics & Analytics Styles
   ============================================================ */

.stats-grid-2 {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(380px, 1fr));
    gap: 24px;
    margin-bottom: 24px;
}

.rank-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    font-weight: 700;
    font-size: 0.82rem;
    background: #f1f5f9;
    color: #475569;
}

.rank-1 { background: #fef3c7; color: #b45309; border: 1px solid #fde68a; }
.rank-2 { background: #f1f5f9; color: #475569; border: 1px solid #cbd5e1; }
.rank-3 { background: #ffedd5; color: #c2410c; border: 1px solid #fed7aa; }

.bar-track {
    background: #f1f5f9;
    border-radius: 6px;
    height: 8px;
    width: 100%;
    overflow: hidden;
    margin-top: 4px;
}

.bar-fill {
    height: 100%;
    border-radius: 6px;
    background: var(--admin-primary);
    transition: width 0.3s ease;
}

.chart-bars-wrap {
    display: flex;
    align-items: flex-end;
    gap: 12px;
    height: 180px;
    padding: 24px 8px 12px;
    border-bottom: 2px solid var(--admin-border);
    margin-bottom: 8px;
}

.chart-bar-col {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    height: 100%;
    justify-content: flex-end;
    position: relative;
}

.chart-bar-val {
    font-size: 0.75rem;
    font-weight: 700;
    color: #475569;
    margin-bottom: 4px;
}

.chart-bar-pill {
    width: 100%;
    max-width: 36px;
    background: linear-gradient(180deg, #ea580c 0%, #c2410c 100%);
    border-radius: 6px 6px 0 0;
    transition: height 0.4s ease;
    min-height: 4px;
}

.chart-bar-pill.today {
    background: linear-gradient(180deg, #16a34a 0%, #15803d 100%);
}

.chart-bar-label {
    font-size: 0.75rem;
    color: #64748b;
    margin-top: 6px;
    text-align: center;
}

