/* =============================================================
   QR Profile Admin CMS — Custom Stylesheet
   Unicode / Indian Language ready | Bootstrap 5 base
   ============================================================= */

/* ---- Global ---- */
*, *::before, *::after { box-sizing: border-box; }

:root {
    --sidebar-width: 250px;
    --sidebar-collapsed: 0px;
    --topbar-height: 56px;
    --sidebar-bg: #ffffff;
    --sidebar-border: #e8ecef;
    --primary: #4361ee;
    --primary-light: #eef0fd;
    --text-main: #1e293b;
    --text-muted: #64748b;
    --bg-body: #f4f7fb;
    --radius: 10px;
    --shadow: 0 2px 12px rgba(0,0,0,.07);
}

html, body {
    height: 100%;
    margin: 0;
}

/* Unicode / Indian language fonts */
body {
    font-family: 'Noto Sans', 'Noto Sans Devanagari', 'Noto Sans Tamil',
                 system-ui, -apple-system, sans-serif;
    font-size: 0.92rem;
    color: var(--text-main);
    background: var(--bg-body);
    line-height: 1.6;
}

/* Ensure Indian script characters render correctly */
.unicode-text,
.unicode-input,
input, textarea, select,
.form-control, .form-select,
td, th {
    font-family: 'Noto Sans', 'Noto Sans Devanagari', 'Noto Sans Tamil',
                 system-ui, sans-serif;
}

/* ---- Auth Layout — Light Theme ---- */
.auth-body {
    background-color: #eef1fb;
    background-image:
        radial-gradient(circle at 20% 20%, rgba(99,102,241,.08) 0%, transparent 55%),
        radial-gradient(circle at 80% 80%, rgba(124,58,237,.07) 0%, transparent 50%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem 1rem;
}

.auth-wrapper {
    width: 100%;
    max-width: 420px;
}

.auth-card {
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 8px 40px rgba(67, 97, 238, .12);
    border: 1px solid #e4eaff;
}

.auth-header {
    background: #fff;
    border-bottom: 1px solid #eef0ff;
    color: #1a1a2e;
    padding: 28px 24px 20px;
}

.auth-header .bi-qr-code-scan {
    color: #4361ee !important;
}

.auth-header h5 {
    color: #1a1a2e;
    font-size: 1.15rem;
}

/* ---- Admin Layout ---- */
.admin-body {
    display: flex;
    min-height: 100vh;
    overflow: hidden;
}

/* Sidebar */
.sidebar {
    width: var(--sidebar-width);
    min-width: var(--sidebar-width);
    background: var(--sidebar-bg);
    border-right: 1px solid var(--sidebar-border);
    height: 100vh;
    position: sticky;
    top: 0;
    overflow-y: auto;
    overflow-x: hidden;
    transition: width .25s ease, min-width .25s ease;
    z-index: 1020;
    box-shadow: 2px 0 12px rgba(0,0,0,.04);
}

.sidebar.collapsed {
    width: 0;
    min-width: 0;
}

.sidebar-header {
    height: var(--topbar-height);
    border-bottom: 1px solid var(--sidebar-border);
    font-size: 0.92rem;
    white-space: nowrap;
    overflow: hidden;
}

.sidebar-user {
    background: #fafbfd;
}

.avatar-sm {
    width: 36px;
    height: 36px;
    font-size: 0.9rem;
    font-weight: 600;
    flex-shrink: 0;
}

/* Sidebar nav */
.sidebar-nav .nav-link {
    color: var(--text-muted);
    border-radius: 8px;
    padding: .5rem .75rem;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    transition: background .15s, color .15s;
}

.sidebar-nav .nav-link:hover {
    background: var(--primary-light);
    color: var(--primary);
}

.sidebar-nav .nav-link.active {
    background: var(--primary-light);
    color: var(--primary);
    font-weight: 600;
}

.sidebar-nav .nav-link i {
    width: 20px;
    text-align: center;
}

/* Language switcher buttons */
.btn-xs {
    padding: 0.15rem 0.45rem;
    font-size: 0.72rem;
    line-height: 1.4;
    border-radius: 4px;
}

/* ---- Main Wrapper ---- */
.main-wrapper {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
    overflow-x: hidden;
}

/* Top Navbar */
.top-navbar {
    height: var(--topbar-height);
    background: #fff;
    border-bottom: 1px solid var(--sidebar-border);
    position: sticky;
    top: 0;
    z-index: 1010;
    box-shadow: 0 1px 4px rgba(0,0,0,.04);
    flex-shrink: 0;
}

/* Content Area */
.content-area {
    flex: 1;
    padding-top: 1.25rem;
}

/* ---- Page Title ---- */
.page-title {
    font-weight: 700;
    font-size: 1.2rem;
    color: var(--text-main);
}

/* ---- Stat Cards ---- */
.stat-card .stat-icon {
    width: 56px;
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.stat-card .stat-number { line-height: 1.1; }

/* ---- Activity List ---- */
.activity-list .activity-item:last-child { border-bottom: none !important; }

.activity-icon {
    width: 32px;
    height: 32px;
    font-size: 0.8rem;
    flex-shrink: 0;
}

/* ---- Tables ---- */
.table thead th {
    font-size: 0.78rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: var(--text-muted);
    border-bottom-width: 1px;
    white-space: nowrap;
}

.table td { vertical-align: middle; }

/* ---- Cards ---- */
.card {
    border-radius: var(--radius);
}

.card-header {
    border-radius: var(--radius) var(--radius) 0 0 !important;
    font-size: 0.88rem;
}

/* ---- Badges ---- */
.badge { font-weight: 500; letter-spacing: 0.02em; }

/* ---- Forms ---- */
.form-label {
    font-size: 0.85rem;
    margin-bottom: .35rem;
}

.form-control, .form-select {
    border-radius: 8px;
    font-size: 0.9rem;
}

.form-control:focus, .form-select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 .2rem rgba(67,97,238,.15);
}

/* ---- Buttons ---- */
.btn {
    border-radius: 8px;
    font-weight: 500;
}

.btn-primary {
    background: var(--primary);
    border-color: var(--primary);
}

.btn-primary:hover, .btn-primary:focus {
    background: #3451d1;
    border-color: #3451d1;
}

/* ---- QR Code Page ---- */
.qr-placeholder {
    min-height: 150px;
    border: 2px dashed #d1d9e0;
    border-radius: var(--radius);
}

/* ---- Profile prose content (about_us) ---- */
.prose-content {
    font-size: 0.95rem;
    line-height: 1.7;
    word-break: break-word;
    overflow-wrap: break-word;
}

.prose-content p { margin-bottom: 0.8rem; }
.prose-content ul, .prose-content ol { padding-left: 1.5rem; margin-bottom: 0.8rem; }

/* ---- Photo Preview ---- */
.photo-preview img {
    object-fit: cover;
}

/* ---- Scrollbar ---- */
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #d0d7de; border-radius: 4px; }

/* ---- Alerts ---- */
.alert {
    border-radius: var(--radius);
    font-size: 0.9rem;
}

/* ---- Pagination ---- */
.pagination {
    margin-bottom: 0;
    font-size: 0.85rem;
}

.page-link { border-radius: 6px !important; margin: 0 2px; }

/* ---- Responsive ---- */
@media (max-width: 991.98px) {
    .sidebar {
        position: fixed;
        left: 0;
        top: 0;
        bottom: 0;
        z-index: 1050;
        transform: translateX(-100%);
        transition: transform .25s ease;
        box-shadow: 4px 0 20px rgba(0,0,0,.15);
    }

    .sidebar.show {
        transform: translateX(0);
    }

    .sidebar-backdrop {
        display: block;
        position: fixed;
        inset: 0;
        background: rgba(0,0,0,.4);
        z-index: 1040;
    }
}

@media (min-width: 992px) {
    .sidebar.collapsed ~ .main-wrapper {
        /* handled via JS class toggle */
    }
}

/* ---- Dark mode prep (future) ---- */
@media (prefers-color-scheme: dark) {
    /* Override when user requests dark mode */
}
