/* ============================================================
   NOIDA I CARE — ADMIN PANEL STYLESHEET
   File: assets/css/admin.css
   ============================================================ */

:root {
    --navy:          #0f2044;
    --navy-mid:      #1a3260;
    --gold:          #c9921a;
    --gold-light:    #e8b84b;
    --gold-pale:     #fdf3dc;
    --saffron:       #e87722;
    --white:         #ffffff;
    --ivory:         #faf8f3;
    --green:         #2d7a4f;
    --green-light:   #e8f5ee;
    --red:           #c62828;
    --red-light:     #ffebee;

    --gray-50:       #fafafa;
    --gray-100:      #f5f5f5;
    --gray-200:      #eeeeee;
    --gray-300:      #e0e0e0;
    --gray-400:      #9e9e9e;
    --gray-500:      #757575;
    --gray-700:      #424242;
    --gray-900:      #212121;

    --font-body:     'DM Sans', 'Segoe UI', sans-serif;
    --sidebar-w:     240px;
    --topbar-h:      60px;
    --radius-sm:     4px;
    --radius-md:     8px;
    --radius-lg:     12px;
    --radius-full:   9999px;
    --shadow-sm:     0 1px 3px rgba(0,0,0,0.08);
    --shadow-md:     0 4px 16px rgba(0,0,0,0.10);
    --transition:    0.2s ease;
}

/* ── Reset ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: var(--font-body); font-size: 0.9rem; color: var(--gray-700); background: var(--gray-100); }
a    { text-decoration: none; color: var(--navy); transition: color var(--transition); }
img  { max-width: 100%; display: block; }
ul   { list-style: none; }
h1,h2,h3,h4 { color: var(--gray-900); font-weight: 700; line-height: 1.3; }

/* ── Layout ── */
.admin-body     { display: flex; min-height: 100vh; }
.admin-sidebar  {
    width: var(--sidebar-w);
    background: var(--navy);
    position: fixed; top: 0; left: 0; bottom: 0;
    display: flex; flex-direction: column;
    z-index: 100; overflow-y: auto;
    border-right: 1px solid rgba(255,255,255,0.06);
}
.admin-main     {
    margin-left: var(--sidebar-w);
    flex: 1; display: flex; flex-direction: column;
    min-height: 100vh;
}
.admin-topbar   {
    height: var(--topbar-h);
    background: var(--white);
    border-bottom: 1px solid var(--gray-200);
    padding: 0 1.5rem;
    display: flex; align-items: center; justify-content: space-between;
    position: sticky; top: 0; z-index: 50;
    box-shadow: var(--shadow-sm);
}
.admin-content  {
    padding: 1.5rem;
    flex: 1;
}

/* ── Sidebar Brand ── */
.sidebar-brand {
    padding: 1.2rem 1rem;
    border-bottom: 1px solid rgba(255,255,255,0.08);
}
.sidebar-brand-link {
    display: flex; align-items: center; gap: 0.6rem;
}
.sidebar-brand-icon { font-size: 1.6rem; flex-shrink: 0; }
.sidebar-site-name  { font-size: 0.95rem; font-weight: 700; color: var(--white); display: block; }
.sidebar-panel-label{ font-size: 0.65rem; color: var(--gold-light); letter-spacing: 0.1em; text-transform: uppercase; }

/* ── Sidebar User ── */
.sidebar-user {
    padding: 1rem;
    display: flex; align-items: center; gap: 0.6rem;
    border-bottom: 1px solid rgba(255,255,255,0.08);
}
.sidebar-user-avatar {
    width: 34px; height: 34px;
    background: linear-gradient(135deg, var(--gold), var(--saffron));
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-weight: 700; font-size: 0.9rem; color: var(--white);
    flex-shrink: 0;
}
.sidebar-user-name { font-size: 0.85rem; font-weight: 600; color: var(--white); display: block; }
.sidebar-user-role { font-size: 0.7rem; color: rgba(255,255,255,0.45); }

/* ── Sidebar Nav ── */
.sidebar-nav { padding: 0.75rem 0; flex: 1; }
.sidebar-nav-item + .sidebar-nav-item { margin-top: 1px; }
.sidebar-nav-link {
    display: flex; align-items: center; gap: 0.65rem;
    padding: 0.65rem 1rem;
    color: rgba(255,255,255,0.65);
    font-size: 0.85rem; font-weight: 500;
    border-radius: var(--radius-md);
    margin: 0 0.5rem;
    transition: all var(--transition);
}
.sidebar-nav-link:hover { background: rgba(255,255,255,0.07); color: var(--white); }
.sidebar-nav-link.active { background: linear-gradient(135deg,var(--gold),var(--saffron)); color: var(--white); box-shadow: 0 2px 8px rgba(201,146,26,0.4); }
.sidebar-nav-icon  { font-size: 1.05rem; flex-shrink: 0; }
.sidebar-nav-label { flex: 1; }

/* ── Sidebar Footer ── */
.sidebar-footer {
    padding: 1rem;
    border-top: 1px solid rgba(255,255,255,0.08);
    display: flex; flex-direction: column; gap: 0.5rem;
}
.sidebar-view-site,
.sidebar-logout {
    display: block;
    padding: 0.55rem 0.75rem;
    border-radius: var(--radius-md);
    font-size: 0.82rem; font-weight: 500;
    transition: all var(--transition);
    text-align: center;
}
.sidebar-view-site { color: rgba(255,255,255,0.6); background: rgba(255,255,255,0.06); }
.sidebar-view-site:hover { background: rgba(255,255,255,0.12); color: var(--white); }
.sidebar-logout    { color: rgba(255,100,100,0.8); background: rgba(255,100,100,0.06); }
.sidebar-logout:hover { background: rgba(255,100,100,0.12); color: #ff6464; }

/* ── Topbar ── */
.topbar-title { font-size: 1rem; font-weight: 700; color: var(--gray-900); }
.topbar-right { display: flex; align-items: center; gap: 1rem; }
.topbar-time  { font-size: 0.8rem; color: var(--gray-400); }

/* ── Dashboard Cards ── */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
    margin-bottom: 1.5rem;
}
.stat-card {
    background: var(--white);
    border-radius: var(--radius-lg);
    padding: 1.25rem;
    border: 1px solid var(--gray-200);
    display: flex; align-items: center; gap: 1rem;
    transition: box-shadow var(--transition);
}
.stat-card:hover { box-shadow: var(--shadow-md); }
.stat-icon {
    width: 48px; height: 48px;
    border-radius: var(--radius-md);
    display: flex; align-items: center; justify-content: center;
    font-size: 1.4rem; flex-shrink: 0;
}
.stat-icon.navy    { background: rgba(15,32,68,0.08); }
.stat-icon.gold    { background: var(--gold-pale); }
.stat-icon.green   { background: var(--green-light); }
.stat-icon.orange  { background: #fff3e0; }
.stat-num   { font-size: 1.8rem; font-weight: 700; color: var(--gray-900); line-height: 1; }
.stat-label { font-size: 0.78rem; color: var(--gray-400); margin-top: 3px; }

/* ── Admin Cards ── */
.admin-card {
    background: var(--white);
    border-radius: var(--radius-lg);
    border: 1px solid var(--gray-200);
    margin-bottom: 1.5rem;
    overflow: hidden;
}
.admin-card-header {
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--gray-200);
    display: flex; align-items: center; justify-content: space-between;
    background: var(--gray-50);
}
.admin-card-header h3 { font-size: 0.9rem; font-weight: 700; }
.admin-card-body   { padding: 1.25rem; }

/* ── Tables ── */
.admin-table-wrap { overflow-x: auto; }
.admin-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
}
.admin-table th {
    padding: 0.65rem 1rem;
    background: var(--gray-50);
    text-align: left;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--gray-400);
    border-bottom: 2px solid var(--gray-200);
    white-space: nowrap;
}
.admin-table td {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--gray-100);
    color: var(--gray-700);
    vertical-align: middle;
}
.admin-table tr:last-child td { border-bottom: none; }
.admin-table tr:hover td { background: var(--gray-50); }

/* ── Badges ── */
.badge {
    display: inline-flex; align-items: center;
    padding: 0.2rem 0.6rem;
    border-radius: var(--radius-full);
    font-size: 0.7rem; font-weight: 700;
    text-transform: uppercase; letter-spacing: 0.05em;
    white-space: nowrap;
}
.badge-active   { background: var(--green-light); color: var(--green); }
.badge-inactive { background: var(--gray-200);    color: var(--gray-500); }
.badge-gold     { background: var(--gold-pale);   color: var(--gold); }
.badge-navy     { background: rgba(15,32,68,0.08); color: var(--navy); }

/* ── Action buttons in tables ── */
.action-btns { display: flex; gap: 0.4rem; flex-wrap: wrap; }
.btn-action {
    padding: 0.3rem 0.7rem;
    border-radius: var(--radius-sm);
    font-size: 0.78rem; font-weight: 600;
    border: none; cursor: pointer;
    transition: all var(--transition);
    font-family: var(--font-body);
    white-space: nowrap;
}
.btn-edit   { background: #e3f2fd; color: #1565c0; }
.btn-edit:hover   { background: #1565c0; color: var(--white); }
.btn-delete { background: var(--red-light); color: var(--red); }
.btn-delete:hover { background: var(--red); color: var(--white); }
.btn-activate   { background: var(--green-light); color: var(--green); }
.btn-activate:hover { background: var(--green); color: var(--white); }
.btn-deactivate { background: #fff3e0; color: #e65100; }
.btn-deactivate:hover { background: #e65100; color: var(--white); }
.btn-view { background: var(--gold-pale); color: var(--gold); }
.btn-view:hover { background: var(--gold); color: var(--white); }

/* ── Admin forms ── */
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; margin-bottom: 1rem; }
.form-row.full { grid-template-columns: 1fr; }
.form-group-admin { display: flex; flex-direction: column; gap: 0.35rem; }
.form-label-admin { font-size: 0.8rem; font-weight: 600; color: var(--gray-700); }
.form-control-admin {
    padding: 0.55rem 0.85rem;
    border: 1.5px solid var(--gray-300);
    border-radius: var(--radius-md);
    font-family: var(--font-body);
    font-size: 0.88rem;
    color: var(--gray-700);
    background: var(--white);
    transition: border-color var(--transition), box-shadow var(--transition);
    outline: none;
}
.form-control-admin:focus { border-color: var(--gold); box-shadow: 0 0 0 3px rgba(201,146,26,0.12); }
textarea.form-control-admin { resize: vertical; min-height: 90px; }
select.form-control-admin  { appearance: none; cursor: pointer; }

/* ── Primary admin button ── */
.btn-admin-primary {
    padding: 0.6rem 1.4rem;
    background: linear-gradient(135deg, var(--gold), var(--saffron));
    color: var(--white);
    border: none;
    border-radius: var(--radius-full);
    font-family: var(--font-body);
    font-size: 0.88rem; font-weight: 600;
    cursor: pointer;
    transition: all var(--transition);
    box-shadow: 0 2px 8px rgba(201,146,26,0.3);
}
.btn-admin-primary:hover { transform: translateY(-1px); box-shadow: 0 4px 16px rgba(201,146,26,0.45); }
.btn-admin-secondary {
    padding: 0.6rem 1.4rem;
    background: var(--gray-100);
    color: var(--gray-700);
    border: 1.5px solid var(--gray-300);
    border-radius: var(--radius-full);
    font-family: var(--font-body);
    font-size: 0.88rem; font-weight: 600;
    cursor: pointer;
    transition: all var(--transition);
}
.btn-admin-secondary:hover { border-color: var(--navy); color: var(--navy); }

/* ── Slider image thumbnails ── */
.slider-thumb-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 1rem;
    margin-bottom: 1.5rem;
}
.slider-thumb {
    position: relative;
    border-radius: var(--radius-md);
    overflow: hidden;
    border: 2px solid var(--gray-200);
    aspect-ratio: 16/9;
    background: var(--gray-100);
    transition: border-color var(--transition);
}
.slider-thumb.active-slide { border-color: var(--gold); }
.slider-thumb img { width: 100%; height: 100%; object-fit: cover; }
.slider-thumb-badge {
    position: absolute; top: 6px; left: 6px;
    background: var(--gold); color: var(--white);
    font-size: 0.65rem; font-weight: 700;
    padding: 2px 6px; border-radius: var(--radius-full);
}
.slider-thumb-order {
    position: absolute; bottom: 6px; right: 6px;
    background: rgba(0,0,0,0.6); color: var(--white);
    font-size: 0.7rem; font-weight: 700;
    padding: 2px 6px; border-radius: var(--radius-sm);
}

/* ── Image upload area ── */
.upload-area {
    border: 2px dashed var(--gray-300);
    border-radius: var(--radius-lg);
    padding: 2.5rem;
    text-align: center;
    background: var(--gray-50);
    cursor: pointer;
    transition: all var(--transition);
}
.upload-area:hover, .upload-area.dragover {
    border-color: var(--gold);
    background: var(--gold-pale);
}
.upload-icon { font-size: 2.5rem; margin-bottom: 0.75rem; }
.upload-area h4 { font-size: 0.95rem; margin-bottom: 0.4rem; }
.upload-area p  { font-size: 0.8rem; color: var(--gray-400); margin: 0; }
.upload-area input[type="file"] { display: none; }
.upload-preview {
    margin-top: 1rem;
    max-width: 300px; margin-left: auto; margin-right: auto;
    border-radius: var(--radius-md); overflow: hidden;
    display: none;
}
.upload-preview img { width: 100%; }

/* ── Alerts ── */
.admin-alert {
    padding: 0.75rem 1rem;
    border-radius: var(--radius-md);
    margin-bottom: 1rem;
    font-size: 0.85rem; font-weight: 500;
    display: flex; align-items: center; gap: 0.5rem;
}
.admin-alert-success { background: var(--green-light); color: #1b5e20; border: 1px solid #a5d6a7; }
.admin-alert-error   { background: var(--red-light);   color: var(--red);  border: 1px solid #ef9a9a; }
.admin-alert-info    { background: #e3f2fd; color: #0d47a1; border: 1px solid #90caf9; }

/* ── Login Page ── */
.admin-login-page {
    min-height: 100vh;
    background: linear-gradient(135deg, var(--navy) 0%, var(--navy-mid) 100%);
    display: flex; align-items: center; justify-content: center;
    padding: 1.5rem;
}
.login-card {
    background: var(--white);
    border-radius: var(--radius-lg);
    padding: 2.5rem;
    width: 100%; max-width: 400px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}
.login-brand {
    text-align: center;
    margin-bottom: 2rem;
}
.login-brand .brand-emoji { font-size: 2.5rem; margin-bottom: 0.5rem; }
.login-brand h2 { font-size: 1.3rem; margin-bottom: 0.25rem; }
.login-brand p  { font-size: 0.82rem; color: var(--gray-400); }
.login-form .form-group-admin { margin-bottom: 1rem; }
.login-btn {
    width: 100%; padding: 0.75rem;
    background: linear-gradient(135deg, var(--navy), var(--navy-mid));
    color: var(--white); border: none; border-radius: var(--radius-md);
    font-size: 0.95rem; font-weight: 600;
    cursor: pointer; transition: all var(--transition);
    font-family: var(--font-body);
    margin-top: 0.5rem;
}
.login-btn:hover { background: linear-gradient(135deg, var(--navy-mid), var(--navy)); box-shadow: 0 4px 16px rgba(15,32,68,0.4); }

/* ── Pagination ── */
.pagination {
    display: flex; gap: 0.4rem;
    justify-content: center;
    margin-top: 1.25rem;
}
.page-btn {
    padding: 0.4rem 0.8rem;
    border: 1.5px solid var(--gray-300);
    border-radius: var(--radius-sm);
    background: var(--white); color: var(--gray-700);
    font-size: 0.82rem; font-weight: 600;
    cursor: pointer; transition: all var(--transition);
    font-family: var(--font-body);
}
.page-btn:hover, .page-btn.active {
    background: var(--navy); border-color: var(--navy); color: var(--white);
}

/* ── Responsive admin ── */
@media (max-width: 900px) {
    .stats-grid { grid-template-columns: repeat(2, 1fr); }
    .slider-thumb-grid { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 640px) {
    .admin-sidebar { transform: translateX(-100%); transition: transform 0.3s ease; }
    .admin-sidebar.open { transform: translateX(0); }
    .admin-main { margin-left: 0; }
    .stats-grid { grid-template-columns: 1fr 1fr; }
    .form-row { grid-template-columns: 1fr; }
    .slider-thumb-grid { grid-template-columns: repeat(2, 1fr); }
}
