/* CAYC Admin Panel Styles */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');

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

:root {
    --primary: #2d7a3e;
    --primary-dark: #1e5a2c;
    --dark: #1a1a2e;
    --dark-light: #232342;
    --sidebar-width: 260px;
    --text: #333;
    --text-light: #777;
    --bg: #f4f6f9;
    --white: #fff;
    --border: #e5e7eb;
    --danger: #dc3545;
    --warning: #ffc107;
    --info: #17a2b8;
    --success: #28a745;
}

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

/* Login Page */
.login-page {
    background: linear-gradient(135deg, var(--dark) 0%, var(--primary) 100%);
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
}

.login-card {
    background: var(--white);
    padding: 50px;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
    width: 100%;
    max-width: 420px;
}

.login-card h1 {
    color: var(--primary);
    font-size: 2em;
    margin-bottom: 5px;
}

.login-card .subtitle {
    color: var(--text-light);
    margin-bottom: 30px;
}

.login-card .error {
    background: #fdf2f2;
    color: var(--danger);
    padding: 12px;
    border-radius: 8px;
    margin-bottom: 20px;
    font-size: 0.9em;
}

/* Layout */
.admin-layout {
    display: flex;
    min-height: 100vh;
}

/* Sidebar */
.sidebar {
    width: var(--sidebar-width);
    background: var(--dark);
    color: #fff;
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    overflow-y: auto;
    z-index: 100;
}

.sidebar-header {
    padding: 25px 20px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.sidebar-header h2 {
    color: var(--primary);
    font-size: 1.3em;
}

.sidebar-header small {
    color: rgba(255,255,255,0.5);
    font-size: 0.8em;
}

.sidebar-nav {
    padding: 15px 0;
    list-style: none;
}

.sidebar-nav li a {
    display: flex;
    align-items: center;
    padding: 12px 25px;
    color: rgba(255,255,255,0.7);
    text-decoration: none;
    transition: all 0.2s;
    font-size: 0.95em;
}

.sidebar-nav li a:hover,
.sidebar-nav li a.active {
    background: rgba(255,255,255,0.08);
    color: #fff;
    border-left: 3px solid var(--primary);
}

.sidebar-nav li a .icon {
    margin-right: 12px;
    font-size: 1.2em;
    width: 25px;
    text-align: center;
}

.sidebar-footer {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 20px;
    border-top: 1px solid rgba(255,255,255,0.1);
}

.sidebar-footer a {
    color: rgba(255,255,255,0.5);
    text-decoration: none;
    font-size: 0.85em;
    display: flex;
    align-items: center;
    gap: 8px;
}

.sidebar-footer a:hover {
    color: #fff;
}

/* Main Content */
.main-content {
    margin-left: var(--sidebar-width);
    flex: 1;
    padding: 30px;
}

/* Top Bar */
.top-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
}

.top-bar h1 {
    font-size: 1.8em;
    color: var(--dark);
}

/* Cards */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background: var(--white);
    padding: 25px;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    display: flex;
    align-items: center;
    gap: 20px;
}

.stat-card .stat-icon {
    width: 55px;
    height: 55px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5em;
}

.stat-card .stat-icon.green { background: rgba(45,122,62,0.1); color: var(--primary); }
.stat-card .stat-icon.blue { background: rgba(23,162,184,0.1); color: var(--info); }
.stat-card .stat-icon.orange { background: rgba(255,193,7,0.1); color: var(--warning); }

.stat-card .stat-info h3 {
    font-size: 2em;
    color: var(--dark);
    line-height: 1;
}

.stat-card .stat-info p {
    color: var(--text-light);
    font-size: 0.9em;
    margin-top: 5px;
}

/* Table */
.table-card {
    background: var(--white);
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    overflow: hidden;
}

.table-card .table-header {
    padding: 20px 25px;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.table-card .table-header h2 {
    font-size: 1.2em;
    color: var(--dark);
}

table {
    width: 100%;
    border-collapse: collapse;
}

table th,
table td {
    padding: 14px 25px;
    text-align: left;
    border-bottom: 1px solid var(--border);
    font-size: 0.95em;
}

table th {
    background: #fafafa;
    color: var(--text-light);
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.8em;
    letter-spacing: 0.5px;
}

table tr:hover {
    background: #f9fafb;
}

/* Badges */
.badge {
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.8em;
    font-weight: 600;
    display: inline-block;
}

.badge-published { background: rgba(40,167,69,0.1); color: var(--success); }
.badge-draft { background: rgba(255,193,7,0.15); color: #d39e00; }
.badge-new { background: rgba(23,162,184,0.1); color: var(--info); }
.badge-read { background: rgba(108,117,125,0.1); color: #6c757d; }
.badge-archived { background: rgba(0,0,0,0.05); color: #999; }

/* Buttons */
.btn {
    display: inline-block;
    padding: 10px 20px;
    border-radius: 8px;
    font-size: 0.9em;
    font-weight: 600;
    text-decoration: none;
    border: none;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { background: #c82333; }
.btn-secondary { background: #e9ecef; color: var(--text); }
.btn-secondary:hover { background: #dee2e6; }
.btn-sm { padding: 6px 14px; font-size: 0.82em; }

.btn-group {
    display: flex;
    gap: 8px;
}

/* Forms */
.form-card {
    background: var(--white);
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

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

.form-group label {
    display: block;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--dark);
    font-size: 0.9em;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 1em;
    font-family: inherit;
    transition: border 0.2s;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(45,122,62,0.1);
}

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

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

/* Detail View */
.detail-card {
    background: var(--white);
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

.detail-row {
    display: flex;
    padding: 12px 0;
    border-bottom: 1px solid var(--border);
}

.detail-row:last-child {
    border-bottom: none;
}

.detail-label {
    width: 180px;
    font-weight: 600;
    color: var(--text-light);
    font-size: 0.9em;
    flex-shrink: 0;
}

.detail-value {
    flex: 1;
    color: var(--dark);
}

/* Alerts */
.alert {
    padding: 12px 20px;
    border-radius: 8px;
    margin-bottom: 20px;
    font-size: 0.95em;
}

.alert-success {
    background: rgba(40,167,69,0.1);
    color: var(--success);
    border: 1px solid rgba(40,167,69,0.2);
}

.alert-danger {
    background: rgba(220,53,69,0.1);
    color: var(--danger);
    border: 1px solid rgba(220,53,69,0.2);
}

/* Responsive */
@media (max-width: 768px) {
    .sidebar { width: 0; display: none; }
    .main-content { margin-left: 0; }
    .form-row { grid-template-columns: 1fr; }
    .stats-grid { grid-template-columns: 1fr; }
}
