/* /assets/css/admin.css
 * ePaper Opti Webopz - Admin Panel Stylesheet
 * Version: 3.0.0
 * Changelog:
 *   2026-03-29 v3.0.0 - Phase 3. Added: reader stats cards, schedule row styles,
 *                        edition badge, stat-value/stat-label classes aligned,
 *                        White label on stat-card, .hint class refinement.
 *   2026-03-25 v1.0.0 - Initial release.
 */

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

:root {
    --primary:      #1a5276;
    --primary-dark: #0e3a55;
    --accent:       #27ae60;
    --danger:       #e74c3c;
    --warning:      #f39c12;
    --bg:           #f4f6f9;
    --bg-white:     #ffffff;
    --text:         #2c3e50;
    --text-muted:   #7f8c8d;
    --border:       #dce1e6;
    --shadow:       0 1px 6px rgba(0,0,0,.06);
    --radius:       6px;
    --font:         'Segoe UI', -apple-system, BlinkMacSystemFont, sans-serif;
    --white:        #ffffff;
}

body { font-family: var(--font); background: var(--bg); color: var(--text); line-height: 1.5; min-height: 100vh; }
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ─── Admin Header ─── */
.admin-header {
    background: var(--primary); color: #fff;
    padding: .6rem 1.5rem;
    display: flex; align-items: center; justify-content: space-between;
    flex-wrap: wrap; gap: .5rem;
    position: sticky; top: 0; z-index: 50;
}
.admin-header h1 { font-size: 1rem; font-weight: 700; }
.admin-header h1 a { color: #fff; }
.admin-header nav { display: flex; gap: .6rem; flex-wrap: wrap; }
.admin-header nav a { color: rgba(255,255,255,.85); font-size: .8rem; font-weight: 500; white-space: nowrap; }
.admin-header nav a:hover { color: #fff; text-decoration: none; }
.admin-header nav a.active { color: #fff; border-bottom: 2px solid #fff; padding-bottom: 2px; }

/* ─── Container ─── */
.admin-container { max-width: 1200px; margin: 0 auto; padding: 1.5rem; }

/* ─── Cards ─── */
.card { background: var(--bg-white); border-radius: var(--radius); box-shadow: var(--shadow); padding: 1.25rem; margin-bottom: 1.25rem; }
.card-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 1rem; flex-wrap: wrap; gap: .5rem; }
.card-header h2 { font-size: 1.1rem; font-weight: 700; color: var(--primary); }

/* ─── Stat Cards ─── */
.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px,1fr)); gap: 1rem; margin-bottom: 1.5rem; }
.stat-card { background: var(--bg-white); border-radius: var(--radius); box-shadow: var(--shadow); padding: 1rem 1.25rem; border-left: 4px solid var(--primary); }
.stat-card .stat-value, .stat-card .stat-num { font-size: 1.8rem; font-weight: 700; color: var(--primary); }
.stat-card .stat-label, .stat-card .stat-lbl { font-size: .8rem; color: var(--text-muted); margin-top: .15rem; }

/* ─── Tables ─── */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: .85rem; }
table th, table td { padding: .55rem .75rem; text-align: left; border-bottom: 1px solid var(--border); }
table th { background: #f8f9fa; font-weight: 600; font-size: .78rem; text-transform: uppercase; letter-spacing: .03em; color: var(--text-muted); white-space: nowrap; }
table tr:hover td { background: #fafbfc; }
table .thumb { width: 60px; height: 40px; object-fit: cover; border-radius: 3px; }

/* ─── Forms ─── */
.form-group { margin-bottom: 1rem; }
.form-group label { display: block; font-size: .82rem; font-weight: 600; margin-bottom: .3rem; color: var(--text); }
.form-group .hint { font-size: .72rem; color: var(--text-muted); margin-top: .2rem; }
.hint { font-size: .72rem; color: var(--text-muted); margin-top: .2rem; }
.form-control { width: 100%; padding: .45rem .65rem; border: 1px solid var(--border); border-radius: var(--radius); font-size: .85rem; font-family: var(--font); outline: none; transition: border-color .2s; }
.form-control:focus { border-color: var(--primary); box-shadow: 0 0 0 2px rgba(26,82,118,.12); }
textarea.form-control { resize: vertical; min-height: 80px; }
select.form-control { cursor: pointer; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }

/* ─── Buttons ─── */
.btn { display: inline-flex; align-items: center; gap: .35rem; padding: .45rem .9rem; border: none; border-radius: var(--radius); font-size: .82rem; font-weight: 600; cursor: pointer; transition: all .2s; text-decoration: none; white-space: nowrap; min-height: 36px; }
.btn:hover { text-decoration: none; }
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); }
.btn-success { background: var(--accent); color: #fff; }
.btn-success:hover { background: #219a52; }
.btn-danger  { background: var(--danger); color: #fff; }
.btn-danger:hover { background: #c0392b; }
.btn-warning { background: var(--warning); color: #fff; }
.btn-warning:hover { background: #d68910; }
.btn-sm { padding: .3rem .6rem; font-size: .75rem; min-height: 30px; }
.btn-outline { background: transparent; border: 1px solid var(--border); color: var(--text); }
.btn-outline:hover { background: #f0f0f0; }

/* ─── Alerts ─── */
.alert { padding: .55rem 1rem; border-radius: var(--radius); margin-bottom: .75rem; font-size: .83rem; display: flex; align-items: center; justify-content: space-between; }
.alert-success { background: #d4edda; color: #155724; border: 1px solid #c3e6cb; }
.alert-danger  { background: #f8d7da; color: #721c24; border: 1px solid #f5c6cb; }
.alert-info    { background: #d1ecf1; color: #0c5460; border: 1px solid #bee5eb; }
.alert-warning { background: #fff3cd; color: #856404; border: 1px solid #ffeaa7; }
.alert-close { background: none; border: none; font-size: 1.1rem; cursor: pointer; color: inherit; opacity: .6; padding: 0 .3rem; }
.alert-close:hover { opacity: 1; }

/* ─── Badges ─── */
.badge { display: inline-block; padding: .15rem .45rem; border-radius: 10px; font-size: .7rem; font-weight: 600; }
.badge-success { background: #d4edda; color: #155724; }
.badge-warning { background: #fff3cd; color: #856404; }
.badge-danger  { background: #f8d7da; color: #721c24; }
.badge-info    { background: #d1ecf1; color: #0c5460; }

/* ─── File upload area ─── */
.upload-area { border: 2px dashed var(--border); border-radius: var(--radius); padding: 1.5rem; text-align: center; cursor: pointer; transition: all .2s; background: #fafbfc; }
.upload-area:hover { border-color: var(--primary); background: #f0f7fc; }
.upload-area input[type="file"] { display: none; }
.upload-area p { color: var(--text-muted); font-size: .85rem; }

/* ─── Image previews ─── */
.image-previews { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px,1fr)); gap: .75rem; margin-top: .75rem; }
.image-preview-item { position: relative; background: var(--bg-white); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.image-preview-item img { width: 100%; height: 100px; object-fit: cover; }
.image-preview-item .remove-img { position: absolute; top: 4px; right: 4px; background: var(--danger); color: #fff; border: none; border-radius: 50%; width: 22px; height: 22px; cursor: pointer; font-size: .75rem; display: flex; align-items: center; justify-content: center; }
.image-preview-item input { width: 100%; padding: .3rem; border: none; border-top: 1px solid var(--border); font-size: .72rem; }

/* ─── Section manager ─── */
.section-list { list-style: none; }
.section-item { display: flex; align-items: center; gap: .75rem; padding: .5rem .75rem; border: 1px solid var(--border); border-radius: var(--radius); margin-bottom: .4rem; background: var(--bg-white); cursor: grab; }
.section-item:active { cursor: grabbing; }
.section-item .drag-handle { color: var(--text-muted); font-size: 1.1rem; }
.section-item .section-name { flex: 1; font-weight: 500; font-size: .85rem; }
.section-item .section-actions { display: flex; gap: .3rem; }

/* ─── Schedule row ─── */
#schedule-row { background: #f0f9ff; border: 1px solid #bae6fd; border-radius: var(--radius); padding: .75rem 1rem; margin-bottom: .75rem; }

/* ─── Readers page ─── */
.reader-email { font-family: monospace; font-size: .82rem; }

/* ─── Dashboard section titles ─── */
.section-title { font-size: .78rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--text-muted); border-bottom: 1px solid var(--border); padding-bottom: .35rem; margin-bottom: .75rem; }

/* ─── Code blocks ─── */
code { background: #f0f0f0; padding: .1rem .3rem; border-radius: 3px; font-size: .82rem; font-family: monospace; }

/* ─── Responsive ─── */
@media (max-width: 900px) {
    .admin-header nav { gap: .4rem; }
    .admin-header nav a { font-size: .75rem; }
}
@media (max-width: 768px) {
    .admin-header { flex-direction: column; align-items: flex-start; }
    .admin-header nav { width: 100%; overflow-x: auto; white-space: nowrap; padding-bottom: .25rem; }
    .admin-container { padding: .75rem; }
    .form-row { grid-template-columns: 1fr; }
    .stats-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 480px) {
    .stats-grid { grid-template-columns: 1fr; }
    table { font-size: .78rem; }
    table th, table td { padding: .4rem .5rem; }
}
