/* ===================================================
   Shabdarutu — Admin Panel Stylesheet
   =================================================== */

@import url('https://fonts.googleapis.com/css2?family=Tiro+Devanagari+Marathi:ital@0;1&family=Mukta:wght@300;400;600;700&display=swap');

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

body {
    font-family: 'Mukta', 'Noto Sans Devanagari', sans-serif;
    background-color: #F5F0E8;
    color: #1A1A1A;
    font-size: 15px;
    line-height: 1.6;
    min-height: 100vh;
}

a { color: #8B0000; text-decoration: none; }
a:hover { color: #6B0000; }
img { max-width: 100%; display: block; }

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

/* ── Sidebar ── */
.admin-sidebar {
    width: 240px;
    flex-shrink: 0;
    background: #1A0000;
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0; left: 0; bottom: 0;
    z-index: 100;
    overflow-y: auto;
}

.sidebar-brand {
    padding: 1.25rem 1rem;
    border-bottom: 1px solid rgba(255,253,245,0.1);
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.sidebar-logo {
    width: 44px;
    height: 44px;
    object-fit: contain;
    background: #FFFDF5;
    border-radius: 50%;
    padding: 3px;
    flex-shrink: 0;
}

.sidebar-brand-text { display: flex; flex-direction: column; }

.sidebar-name {
    font-family: 'Tiro Devanagari Marathi', serif;
    font-size: 1.1rem;
    color: #FFFDF5;
    font-weight: 700;
    line-height: 1.2;
}

.sidebar-subtitle {
    font-size: 0.7rem;
    color: rgba(255,253,245,0.5);
    margin-top: 2px;
}

.sidebar-nav { flex: 1; padding: 1rem 0; }

.nav-group { margin-bottom: 0.25rem; }

.nav-label {
    font-size: 0.68rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: rgba(255,253,245,0.35);
    padding: 0.5rem 1rem 0.2rem;
    font-weight: 700;
}

.sidebar-nav a {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    padding: 0.65rem 1rem;
    color: rgba(255,253,245,0.75);
    font-size: 0.95rem;
    font-weight: 500;
    border-left: 3px solid transparent;
    transition: all 0.2s;
}

.sidebar-nav a:hover {
    background: rgba(255,253,245,0.07);
    color: #FFFDF5;
    text-decoration: none;
    border-left-color: rgba(255,253,245,0.3);
}

.sidebar-nav a.active {
    background: rgba(139,0,0,0.5);
    color: #FFFDF5;
    border-left-color: #FFFDF5;
}

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

.sidebar-footer {
    padding: 1rem;
    border-top: 1px solid rgba(255,253,245,0.1);
}

.sidebar-footer a {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    color: rgba(255,253,245,0.5);
    font-size: 0.85rem;
    padding: 0.4rem 0;
    transition: color 0.2s;
}

.sidebar-footer a:hover { color: rgba(255,253,245,0.9); text-decoration: none; }

/* ── Main Content Area ── */
.admin-main {
    margin-left: 240px;
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* ── Top Bar ── */
.admin-topbar {
    background: #FFFDF5;
    border-bottom: 1px solid #E0D0C0;
    padding: 0.85rem 1.75rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 50;
    box-shadow: 0 1px 4px rgba(0,0,0,0.07);
}

.topbar-title {
    font-family: 'Tiro Devanagari Marathi', serif;
    font-size: 1.3rem;
    color: #8B0000;
    font-weight: 700;
}

.topbar-user {
    font-size: 0.85rem;
    color: #666;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

/* ── Admin Content ── */
.admin-content {
    padding: 1.75rem;
    flex: 1;
}

/* ── Stat Cards ── */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1.25rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: #FFFFFF;
    border: 1px solid #E0D0C0;
    border-radius: 8px;
    padding: 1.25rem 1.5rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    box-shadow: 0 2px 6px rgba(0,0,0,0.05);
    border-top: 3px solid #8B0000;
}

.stat-icon {
    font-size: 2rem;
    background: #FFF0F0;
    width: 54px; height: 54px;
    display: flex; align-items: center; justify-content: center;
    border-radius: 50%;
    flex-shrink: 0;
}

.stat-info { flex: 1; }

.stat-label {
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    color: #888;
    font-weight: 600;
    margin-bottom: 0.15rem;
}

.stat-value {
    font-size: 1.8rem;
    font-weight: 700;
    color: #8B0000;
    line-height: 1;
}

.stat-sub {
    font-size: 0.78rem;
    color: #999;
    margin-top: 0.15rem;
}

/* ── Cards ── */
.admin-card {
    background: #FFFFFF;
    border: 1px solid #E0D0C0;
    border-radius: 8px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.05);
    margin-bottom: 1.75rem;
    overflow: hidden;
}

.card-header {
    background: #8B0000;
    color: #FFFDF5;
    padding: 0.85rem 1.25rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.card-header h2 {
    font-family: 'Tiro Devanagari Marathi', serif;
    font-size: 1.1rem;
    font-weight: 700;
}

.card-body { padding: 1.5rem; }

/* ── Form Styles ── */
.form-group { margin-bottom: 1.25rem; }

.form-label {
    display: block;
    font-weight: 600;
    margin-bottom: 0.4rem;
    color: #333;
    font-size: 0.9rem;
}

.form-label .required { color: #8B0000; margin-left: 2px; }

.form-control {
    width: 100%;
    padding: 0.6rem 0.9rem;
    border: 1px solid #CCC;
    border-radius: 4px;
    font-family: 'Mukta', sans-serif;
    font-size: 0.95rem;
    color: #1A1A1A;
    background: #FEFEFE;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.form-control:focus {
    outline: none;
    border-color: #8B0000;
    box-shadow: 0 0 0 3px rgba(139,0,0,0.12);
}

.form-hint {
    font-size: 0.78rem;
    color: #888;
    margin-top: 0.3rem;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.25rem;
}

/* File Input */
.file-input-wrap {
    border: 2px dashed #D0B0A0;
    border-radius: 6px;
    padding: 1.5rem;
    text-align: center;
    transition: border-color 0.2s;
    cursor: pointer;
    background: #FFFAF5;
}

.file-input-wrap:hover { border-color: #8B0000; }
.file-input-wrap input[type="file"] { display: none; }
.file-input-label {
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.4rem;
    color: #666;
    font-size: 0.9rem;
}
.file-input-icon { font-size: 2rem; }
.file-input-name { font-size: 0.8rem; color: #8B0000; font-weight: 600; margin-top: 0.25rem; }

/* ── Buttons ── */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.6rem 1.4rem;
    border-radius: 4px;
    font-family: 'Mukta', sans-serif;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    border: 2px solid transparent;
    transition: all 0.2s;
    text-decoration: none;
    line-height: 1;
}

.btn-primary   { background: #8B0000; color: #FFFDF5; border-color: #8B0000; }
.btn-primary:hover { background: #6B0000; border-color: #6B0000; color: #FFFDF5; text-decoration: none; }

.btn-secondary { background: #F0E8DC; color: #5A3020; border-color: #D0B090; }
.btn-secondary:hover { background: #E0D0C0; text-decoration: none; color: #5A3020; }

.btn-danger    { background: #fff; color: #CC0000; border-color: #CC0000; }
.btn-danger:hover { background: #CC0000; color: #fff; text-decoration: none; }

.btn-success   { background: #1a6e1a; color: #fff; border-color: #1a6e1a; }
.btn-success:hover { background: #145214; text-decoration: none; color: #fff; }

.btn-sm { padding: 0.35rem 0.85rem; font-size: 0.82rem; }
.btn-xs { padding: 0.2rem 0.6rem; font-size: 0.75rem; }

/* ── Table ── */
.admin-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.88rem;
}

.admin-table th {
    background: #F8F0E8;
    color: #5A3020;
    font-weight: 700;
    padding: 0.7rem 1rem;
    text-align: left;
    border-bottom: 2px solid #D0B090;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.admin-table td {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid #EDE0D0;
    vertical-align: middle;
    color: #333;
}

.admin-table tr:last-child td { border-bottom: none; }
.admin-table tr:hover td { background: #FFF8F0; }

.table-thumb {
    width: 50px;
    height: 65px;
    object-fit: cover;
    border-radius: 3px;
    border: 1px solid #D0C0B0;
}

.table-thumb-placeholder {
    width: 50px; height: 65px;
    background: #F0E5D5;
    border-radius: 3px;
    border: 1px solid #D0C0B0;
    display: flex; align-items: center; justify-content: center;
    font-size: 1.4rem;
    color: #C0A080;
}

/* Badges */
.badge {
    display: inline-block;
    padding: 0.15rem 0.55rem;
    border-radius: 20px;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.04em;
}

.badge-active   { background: #e6f5e6; color: #1a6e1a; }
.badge-inactive { background: #fde8e8; color: #8B0000; }

/* ── Alert / Flash ── */
.alert {
    padding: 0.85rem 1.25rem;
    border-radius: 4px;
    margin-bottom: 1.25rem;
    font-weight: 500;
    border-left: 4px solid;
    font-size: 0.9rem;
}
.alert-success { background: #f0faf0; color: #1a5c1a; border-color: #2d862d; }
.alert-error   { background: #fff0f0; color: #8B0000; border-color: #8B0000; }
.alert-info    { background: #f0f6ff; color: #1a3d70; border-color: #2b5fad; }

/* ── Login Page ── */
.login-page {
    min-height: 100vh;
    background: linear-gradient(135deg, #1A0000 0%, #3A0000 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem 1rem;
}

.login-box {
    background: #FFFDF5;
    border-radius: 10px;
    width: 100%;
    max-width: 400px;
    overflow: hidden;
    box-shadow: 0 10px 40px rgba(0,0,0,0.4);
}

.login-header {
    background: #8B0000;
    padding: 2rem;
    text-align: center;
}

.login-logo {
    width: 72px; height: 72px;
    object-fit: contain;
    background: #FFFDF5;
    border-radius: 50%;
    padding: 5px;
    margin: 0 auto 0.75rem;
    border: 3px solid rgba(255,253,245,0.3);
}

.login-title {
    font-family: 'Tiro Devanagari Marathi', serif;
    font-size: 1.8rem;
    color: #FFFDF5;
    font-weight: 700;
}

.login-subtitle {
    font-size: 0.82rem;
    color: rgba(255,253,245,0.65);
    margin-top: 0.25rem;
}

.login-form { padding: 2rem; }

.login-form .form-control {
    padding: 0.75rem 1rem;
    font-size: 1rem;
    border: 1.5px solid #D0C0B0;
}

.btn-login {
    width: 100%;
    padding: 0.85rem;
    font-size: 1.05rem;
    margin-top: 0.5rem;
}

.login-footer {
    text-align: center;
    padding: 0.75rem;
    background: #F8F0E0;
    font-size: 0.78rem;
    color: #888;
    border-top: 1px solid #E0D0B0;
}

/* ── Thumbnail Preview ── */
.thumb-preview {
    margin-top: 0.75rem;
    display: none;
}
.thumb-preview img {
    max-width: 120px;
    max-height: 160px;
    border: 2px solid #D0B090;
    border-radius: 4px;
}

/* ── Responsive Admin ── */
@media (max-width: 900px) {
    .admin-sidebar { width: 200px; }
    .admin-main { margin-left: 200px; }
}

@media (max-width: 700px) {
    .admin-sidebar { display: none; }
    .admin-main { margin-left: 0; }
    .form-row { grid-template-columns: 1fr; }
    .admin-content { padding: 1rem; }
}
