/**
 * OAKOKHO SSO SYSTEM — UNIFIED STYLESHEET
 * Covers: auth pages, dashboard, admin pages
 * Font: Noto Sans Bengali (loaded via Google Fonts in each page)
 */

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

/* ── BASE ─────────────────────────────────────────────────────────────────── */
body {
    font-family: 'Noto Sans Bengali', -apple-system, BlinkMacSystemFont,
        'Segoe UI', Roboto, Arial, sans-serif;
    background: linear-gradient(135deg, #1a5f2a 0%, #0d3d1a 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    color: #333;
    -webkit-font-smoothing: antialiased;
}

/* Dashboard/admin pages — override flex-center layout */
body.dashboard-page {
    background: #f0f2f0;
    display: block;
    padding: 0;
    align-items: unset;
    justify-content: unset;
}

/* ── UNIFIED NAVBAR ───────────────────────────────────────────────────────── */
.oak-navbar {
    background: #1a5f2a;
    color: #fff;
    padding: 0 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 52px;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 2px 8px rgba(0, 0, 0, .28);
}

.oak-navbar-brand {
    font-size: 20px;
    font-weight: 700;
    color: #fff;
    text-decoration: none;
    letter-spacing: .4px;
    flex-shrink: 0;
}

.oak-navbar-brand:hover {
    opacity: .85;
}

.oak-navbar-links {
    display: flex;
    align-items: center;
    gap: 3px;
    flex-wrap: wrap;
}

.oak-navbar-welcome {
    font-size: 13px;
    color: rgba(255, 255, 255, .72);
    padding: 0 12px 0 4px;
    border-right: 1px solid rgba(255, 255, 255, .25);
    margin-right: 6px;
    white-space: nowrap;
    max-width: 180px;
    overflow: hidden;
    text-overflow: ellipsis;
}

.oak-navbar-links a {
    color: rgba(255, 255, 255, .88);
    text-decoration: none;
    font-size: 13px;
    font-weight: 500;
    padding: 6px 12px;
    border-radius: 5px;
    transition: background .15s;
    white-space: nowrap;
}

.oak-navbar-links a:hover {
    background: rgba(255, 255, 255, .15);
    color: #fff;
}

.oak-navbar-links a.active {
    background: rgba(255, 255, 255, .22);
    color: #fff;
    font-weight: 600;
}

.oak-navbar-logout {
    background: rgba(220, 38, 38, .18) !important;
    color: #fca5a5 !important;
    margin-left: 4px;
}

.oak-navbar-logout:hover {
    background: rgba(220, 38, 38, .38) !important;
    color: #fff !important;
}

@media (max-width: 640px) {
    .oak-navbar {
        height: auto;
        padding: 10px 16px;
        flex-wrap: wrap;
        gap: 8px;
    }

    .oak-navbar-welcome {
        border-right: none;
        padding-right: 0;
    }
}

/* ── AUTH CONTAINER (login, register, forgot-password) ───────────────────── */
.auth-container {
    background: #fff;
    border-radius: 14px;
    box-shadow: 0 12px 48px rgba(0, 0, 0, .32);
    width: 100%;
    max-width: 480px;
    overflow: hidden;
}

.auth-header {
    background: #1a5f2a;
    color: #fff;
    padding: 30px;
    text-align: center;
}

.auth-header h1 {
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 5px;
    letter-spacing: .5px;
}

.auth-header p {
    opacity: .88;
    font-size: 14px;
}

.auth-form {
    padding: 30px;
}

/* ── FORM ELEMENTS ────────────────────────────────────────────────────────── */
.form-group {
    margin-bottom: 18px;
}

.form-group label {
    display: block;
    margin-bottom: 7px;
    color: #333;
    font-weight: 500;
    font-size: 14px;
}

.auth-form input[type="tel"],
.form-group input[type="text"],
.form-group input[type="email"],
.form-group input[type="password"] {
    width: 100%;
    padding: 11px 14px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 15px;
    font-family: 'Noto Sans Bengali', -apple-system, BlinkMacSystemFont,
        'Segoe UI', Roboto, Arial, sans-serif;
    color: #222;
    transition: border-color .25s, box-shadow .25s;
    background: #fff;
}

.form-group input[type="tel"]:focus,
.form-group input[type="text"]:focus,
.form-group input[type="email"]:focus,
.form-group input[type="password"]:focus {
    outline: none;
    border-color: #1a5f2a;
    box-shadow: 0 0 0 3px rgba(26, 95, 42, .12);
}

.form-group input.error {
    border-color: #dc2626;
}

.form-group .error-text {
    color: #dc2626;
    font-size: 12px;
    margin-top: 5px;
}

.form-group .hint {
    color: #888;
    font-size: 12px;
    margin-top: 5px;
}

/* FORM ROW */
.form-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.remember-me {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-size: 14px;
    color: #555;
}

.remember-me input[type="checkbox"] {
    width: 17px;
    height: 17px;
    accent-color: #1a5f2a;
    cursor: pointer;
}

.forgot-link {
    color: #1a5f2a;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
}

.forgot-link:hover {
    text-decoration: underline;
}

/* ── BUTTONS ──────────────────────────────────────────────────────────────── */
.btn {
    display: inline-block;
    width: 100%;
    padding: 13px 20px;
    background: #1a5f2a;
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: background .2s, box-shadow .2s;
    margin-top: 8px;
    text-align: center;
    text-decoration: none;
}

.btn:hover {
    background: #145222;
    box-shadow: 0 4px 14px rgba(26, 95, 42, .28);
}

.btn-danger {
    background: #dc2626;
}

.btn-danger:hover {
    background: #b91c1c;
    box-shadow: 0 4px 14px rgba(220, 38, 38, .28);
}

/* ── MESSAGES ─────────────────────────────────────────────────────────────── */
.error-message {
    background: #fef2f2;
    border: 1px solid #fecaca;
    color: #991b1b;
    padding: 12px 16px;
    border-radius: 8px;
    margin-bottom: 20px;
    font-size: 14px;
}

.success-message {
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    color: #166534;
    padding: 20px;
    border-radius: 8px;
    text-align: center;
    font-size: 14px;
}

.success-message h3 {
    margin-bottom: 8px;
    font-size: 16px;
}

.redirect-notice {
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    color: #166534;
    padding: 10px 15px;
    border-radius: 8px;
    margin-bottom: 18px;
    font-size: 13px;
}

/* ── AUTH LINKS ───────────────────────────────────────────────────────────── */
.auth-link {
    text-align: center;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #eee;
    color: #666;
    font-size: 14px;
}

.auth-link a {
    color: #1a5f2a;
    text-decoration: none;
    font-weight: 600;
}

.auth-link a:hover {
    text-decoration: underline;
}

/* ── PASSWORD STRENGTH ────────────────────────────────────────────────────── */
.password-strength {
    height: 4px;
    background: #e5e7eb;
    border-radius: 2px;
    margin-top: 8px;
    overflow: hidden;
}

.password-strength-bar {
    height: 100%;
    width: 0;
    transition: all .3s;
}

.strength-weak {
    width: 33%;
    background: #ef4444;
}

.strength-medium {
    width: 66%;
    background: #f59e0b;
}

.strength-strong {
    width: 100%;
    background: #22c55e;
}

/* ── DASHBOARD LAYOUT ─────────────────────────────────────────────────────── */
.dashboard-container {
    max-width: 1060px;
    margin: 28px auto;
    padding: 0 20px 40px;
}

/* CARDS */
.card {
    background: #fff;
    border-radius: 12px;
    padding: 24px;
    margin-bottom: 24px;
    box-shadow: 0 1px 6px rgba(0, 0, 0, .1);
}

.card h2 {
    color: #1a5f2a;
    font-size: 20px;
    margin-bottom: 8px;
}

.card h3 {
    color: #333;
    font-size: 16px;
    margin-bottom: 16px;
    padding-bottom: 14px;
    border-bottom: 1px solid #eee;
}

.card p {
    color: #666;
    font-size: 14px;
}

/* USER INFO GRID */
.user-info {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 14px;
    margin-top: 18px;
}

.info-item {
    background: #f8faf8;
    padding: 14px;
    border-radius: 8px;
    border: 1px solid #e8f0e8;
}

.info-item label {
    display: block;
    font-size: 11px;
    color: #888;
    margin-bottom: 4px;
    text-transform: uppercase;
    letter-spacing: .4px;
}

.info-item span {
    color: #222;
    font-weight: 500;
    font-size: 14px;
}

/* SITES GRID */
.sites-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 18px;
    margin-bottom: 24px;
}

.site-card {
    background: #fff;
    border-radius: 12px;
    padding: 22px;
    box-shadow: 0 1px 6px rgba(0, 0, 0, .1);
    transition: transform .2s, box-shadow .2s;
    border-top: 3px solid #1a5f2a;
}

.site-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, .14);
}

.site-card h3 {
    color: #1a5f2a;
    margin-bottom: 8px;
    padding-bottom: 0;
    border-bottom: none;
    font-size: 17px;
}

.site-card p {
    color: #666;
    font-size: 13px;
    margin-bottom: 14px;
}

.site-card a {
    color: #1a5f2a;
    text-decoration: none;
    font-weight: 600;
    font-size: 13px;
}

.site-card a:hover {
    text-decoration: underline;
}

/* SESSIONS LIST */
.session-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 13px 0;
    border-bottom: 1px solid #f0f0f0;
}

.session-item:last-child {
    border-bottom: none;
}

.session-info {
    flex: 1;
}

.session-domain {
    font-weight: 600;
    color: #333;
    font-size: 14px;
}

.session-meta {
    font-size: 12px;
    color: #888;
    margin-top: 3px;
}

.session-current {
    background: #f0fdf4;
    color: #166534;
    border: 1px solid #bbf7d0;
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
}

/* ── ADMIN PAGE LAYOUT ────────────────────────────────────────────────────── */
.admin-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 28px 20px 48px;
}

.page-title {
    color: #1a5f2a;
    font-size: 26px;
    margin-bottom: 4px;
    font-weight: 700;
}

.admin-badge {
    display: inline-block;
    padding: 3px 10px;
    background: #dc2626;
    color: #fff;
    border-radius: 5px;
    font-size: 12px;
    font-weight: 600;
    margin-left: 8px;
    vertical-align: middle;
}

.page-subtitle {
    color: #666;
    font-size: 13px;
    margin-bottom: 24px;
}

.page-subtitle a {
    color: #1a5f2a;
    text-decoration: none;
    font-weight: 600;
}

/* STATS GRID */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 14px;
    margin-bottom: 22px;
}

.stat-card {
    background: #fff;
    padding: 18px 20px;
    border-radius: 10px;
    box-shadow: 0 1px 4px rgba(0, 0, 0, .1);
    border-top: 3px solid #1a5f2a;
}

.stat-card h3 {
    font-size: 11px;
    color: #888;
    margin-bottom: 6px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .5px;
}

.stat-card .number {
    font-size: 32px;
    font-weight: 700;
    color: #1a5f2a;
    line-height: 1;
}

/* FILTER / SEARCH CARD */
.filters-card {
    background: #fff;
    padding: 18px;
    border-radius: 10px;
    box-shadow: 0 1px 4px rgba(0, 0, 0, .1);
    margin-bottom: 20px;
}

.filters-form {
    display: grid;
    grid-template-columns: 1fr 180px 180px auto;
    gap: 12px;
    align-items: end;
}

.fg label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: #555;
    margin-bottom: 5px;
    text-transform: uppercase;
    letter-spacing: .4px;
}

.fg input,
.fg select {
    width: 100%;
    padding: 9px 12px;
    border: 1.5px solid #ddd;
    border-radius: 7px;
    font-size: 14px;
    font-family: inherit;
    color: #333;
    background: #fff;
    transition: border-color .2s;
}

.fg input:focus,
.fg select:focus {
    outline: none;
    border-color: #1a5f2a;
    box-shadow: 0 0 0 3px rgba(26, 95, 42, .1);
}

/* SEARCH BOX (simple, full-width) */
.search-box {
    background: #fff;
    padding: 14px 16px;
    border-radius: 10px;
    box-shadow: 0 1px 4px rgba(0, 0, 0, .1);
    margin-bottom: 18px;
}

.search-box input {
    width: 100%;
    padding: 10px 14px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 14px;
    font-family: inherit;
    color: #333;
    transition: border-color .2s, box-shadow .2s;
}

.search-box input:focus {
    outline: none;
    border-color: #1a5f2a;
    box-shadow: 0 0 0 3px rgba(26, 95, 42, .1);
}

/* TABLE CARD */
.table-card {
    background: #fff;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 1px 4px rgba(0, 0, 0, .1);
}

.table-card-header {
    padding: 14px 18px;
    border-bottom: 1px solid #e5e7eb;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.table-card-header h3 {
    font-size: 16px;
    color: #1a5f2a;
    font-weight: 600;
}

.table-card-header a {
    font-size: 13px;
    color: #dc2626;
    text-decoration: none;
    font-weight: 500;
}

.table-wrap {
    overflow-x: auto;
}

/* TABLE */
.users-table {
    background: #fff;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 1px 4px rgba(0, 0, 0, .1);
}

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

thead {
    background: #1a5f2a;
    color: #fff;
}

th {
    padding: 13px 14px;
    text-align: left;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .5px;
    white-space: nowrap;
}

td {
    padding: 11px 14px;
    border-top: 1px solid #f0f0f0;
    font-size: 13px;
    color: #333;
}

tbody tr:hover {
    background: #f9fafb;
}

/* BADGES */
.badge {
    display: inline-block;
    padding: 3px 9px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 600;
    margin: 1px;
    white-space: nowrap;
}

.badge-success {
    background: #dcfce7;
    color: #166534;
}

.badge-danger {
    background: #fee2e2;
    color: #991b1b;
}

.badge-warning {
    background: #fef9c3;
    color: #854d0e;
}

.badge-info {
    background: #dbeafe;
    color: #1e40af;
}

.badge-admin {
    background: #fce7f3;
    color: #9d174d;
}

/* PAGINATION */
.pagination {
    margin-top: 20px;
    text-align: center;
    padding: 16px;
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 1px 4px rgba(0, 0, 0, .1);
}

/* Pagination inside table-card */
.table-card .pagination {
    margin-top: 0;
    border-radius: 0;
    box-shadow: none;
    border-top: 1px solid #e5e7eb;
    display: flex;
    justify-content: space-between;
    align-items: center;
    text-align: left;
}

.pagination a,
.pagination span {
    display: inline-block;
    padding: 7px 14px;
    margin: 0 3px;
    background: #fff;
    border: 1.5px solid #e0e0e0;
    border-radius: 7px;
    text-decoration: none;
    color: #333;
    font-weight: 500;
    font-size: 13px;
    transition: all .2s;
}

.pagination a:hover {
    background: #1a5f2a;
    color: #fff;
    border-color: #1a5f2a;
}

.pagination .active {
    background: #1a5f2a;
    color: #fff;
    border-color: #1a5f2a;
}

.pagination .disabled {
    opacity: .4;
    cursor: not-allowed;
}

.pg-info {
    font-size: 13px;
    color: #6b7280;
}

.pg-btns {
    display: flex;
    gap: 4px;
}

/* EMPTY STATE */
.empty-state {
    padding: 48px;
    text-align: center;
    color: #9ca3af;
}

.empty-state h3 {
    margin-bottom: 6px;
    color: #6b7280;
}

/* FOOTER INFO */
.footer-info {
    margin-top: 14px;
    text-align: center;
    color: #888;
    font-size: 13px;
}

/* ── AKG (API KEY GENERATOR) ─────────────────────────────────────────────── */
.akg-wrap {
    max-width: 640px;
    margin: 36px auto;
    padding: 0 20px 60px;
}

.akg-card {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 1px 6px rgba(0, 0, 0, .1);
    padding: 30px;
}

.akg-card h2 {
    color: #1a5f2a;
    font-size: 22px;
    margin-bottom: 4px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.akg-subtitle {
    color: #666;
    font-size: 13px;
    margin-bottom: 22px;
}

.info-box {
    background: #f0fdf4;
    border-left: 4px solid #1a5f2a;
    padding: 14px 16px;
    margin-bottom: 20px;
    border-radius: 0 6px 6px 0;
}

.info-box h3 {
    color: #1a5f2a;
    font-size: 14px;
    margin-bottom: 8px;
    font-weight: 600;
}

.info-box p,
.info-box li {
    color: #555;
    font-size: 13px;
    line-height: 1.6;
}

.info-box ul {
    margin: 8px 0 0 18px;
}

.generate-btn {
    width: 100%;
    background: #1a5f2a;
    color: #fff;
    border: none;
    padding: 13px;
    font-size: 15px;
    font-weight: 600;
    font-family: inherit;
    border-radius: 8px;
    cursor: pointer;
    transition: background .2s, box-shadow .2s;
    margin-bottom: 18px;
}

.generate-btn:hover {
    background: #145222;
    box-shadow: 0 4px 14px rgba(26, 95, 42, .28);
}

.result-box {
    background: #f0fdf4;
    border: 2px solid #1a5f2a;
    border-radius: 8px;
    padding: 18px;
    margin-top: 4px;
}

.result-label {
    color: #1a5f2a;
    font-weight: 600;
    font-size: 13px;
    margin-bottom: 10px;
    display: block;
}

.api-key-display {
    background: #fff;
    border: 1px solid #d1d5db;
    padding: 13px 14px;
    border-radius: 6px;
    font-family: 'Courier New', Consolas, monospace;
    font-size: 13px;
    word-break: break-all;
    color: #111;
    margin-bottom: 10px;
    letter-spacing: .5px;
}

.key-timestamp {
    color: #888;
    font-size: 12px;
    margin-bottom: 14px;
}

.key-actions {
    display: flex;
    gap: 10px;
}

.copy-btn,
.clear-btn {
    flex: 1;
    padding: 10px;
    border: none;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: all .2s;
}

.copy-btn {
    background: #10b981;
    color: #fff;
}

.copy-btn:hover {
    background: #059669;
}

.copy-btn.copied {
    background: #3b82f6;
}

.clear-btn {
    background: #ef4444;
    color: #fff;
}

.clear-btn:hover {
    background: #dc2626;
}

.footer-note {
    text-align: center;
    margin-top: 18px;
    color: #9ca3af;
    font-size: 12px;
}

/* ── ACCESS DENIED ───────────────────────────────────────────────────────── */
.access-denied-wrap {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: calc(100vh - 52px);
    padding: 20px;
    background: #f0f2f0;
}

.access-denied-box {
    background: #fff;
    padding: 56px 40px;
    border-radius: 16px;
    text-align: center;
    max-width: 480px;
    width: 100%;
    box-shadow: 0 8px 32px rgba(0, 0, 0, .15);
}

.access-denied-box h1 {
    color: #dc2626;
    font-size: 28px;
    margin-bottom: 12px;
}

.access-denied-box p {
    color: #666;
    font-size: 15px;
    margin-bottom: 28px;
    line-height: 1.6;
}

/* ── RESPONSIVE ───────────────────────────────────────────────────────────── */
@media (max-width: 768px) {
    .filters-form {
        grid-template-columns: 1fr;
    }

    .table-card .pagination {
        flex-direction: column;
        gap: 12px;
    }

    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 600px) {
    .auth-container {
        max-width: 100%;
    }

    .form-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    .dashboard-container {
        padding: 0 12px 30px;
    }

    .admin-container {
        padding: 16px 12px 40px;
    }

    .sites-grid {
        grid-template-columns: 1fr;
    }

    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}