/* ═══════════════════════════════════════════
   HisarPin Admin Panel — Sales Dashboard Dark
   #171821 bg, #A9DFD8 accent mint
   ═══════════════════════════════════════════ */

:root {
    --bg-body: #171821;
    --bg-sidebar: #171821;
    --bg-topbar: #171821;
    --bg-card: #21222D;
    --bg-card-hover: #282936;
    --bg-input: #21222D;

    --border: rgba(255, 255, 255, 0.08);
    --border-hover: rgba(255, 255, 255, 0.15);

    --text-primary: #ffffff;
    --text-secondary: #87888C;
    --text-muted: #87888C;
    --text-dim: #5a5b60;

    --accent: #A9DFD8;
    --accent-light: #C2EAE5;
    --accent-glow: rgba(169, 223, 216, 0.12);
    --accent-gradient: linear-gradient(135deg, #A9DFD8, #A9DFD8);

    --mint: #A9DFD8;
    --mint-light: #C2EAE5;
    --mint-glow: rgba(169, 223, 216, 0.12);

    --success: #10b981;
    --success-bg: rgba(16, 185, 129, 0.12);
    --danger: #ef4444;
    --danger-bg: rgba(239, 68, 68, 0.12);
    --warning: #eab308;
    --offline: #6b7280;
    --offline-bg: rgba(107, 114, 128, 0.12);

    --radius: 14px;
    --radius-sm: 10px;
    --radius-xs: 8px;
    --radius-pill: 999px;
    --sidebar-width: 250px;
    --topbar-height: 56px;

    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.5);

    --font: 'Inter', system-ui, -apple-system, sans-serif;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font);
    background: var(--bg-body);
    color: var(--text-primary);
    min-height: 100vh;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    font-size: 13px;
}

/* ═══ LOGIN ═══ */
.login-screen {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
}

.login-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 48px 40px;
    width: 100%;
    max-width: 400px;
    text-align: center;
}

.login-logo {
    margin-bottom: 16px;
}

.login-card h1 {
    font-size: 1.6rem;
    font-weight: 700;
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 4px;
}

.login-subtitle {
    color: var(--text-muted);
    font-size: 0.8rem;
    margin-bottom: 28px;
}

/* ═══ INPUTS ═══ */
.input-group {
    text-align: left;
    margin-bottom: 14px;
}

.input-group label {
    display: block;
    font-size: 11px;
    font-weight: 500;
    color: var(--text-muted);
    margin-bottom: 5px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.input-group input,
.input-group textarea,
.input-group select {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius-xs);
    background: var(--bg-input);
    color: var(--text-primary);
    font-family: var(--font);
    font-size: 13px;
    transition: border-color 0.15s;
    outline: none;
}

.input-group input:focus,
.input-group textarea:focus,
.input-group select:focus {
    border-color: var(--mint);
    box-shadow: 0 0 12px var(--mint-glow);
}

.input-group select {
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='10' viewBox='0 0 24 24' fill='none' stroke='%236b7280' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
    padding-right: 30px;
}

.input-group select option {
    background: #21222D;
    color: var(--text-primary);
}

/* Checkbox */
.checkbox-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 6px 0;
}

.checkbox-group label {
    display: flex !important;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-size: 13px;
    color: var(--text-secondary);
    text-transform: none;
    letter-spacing: 0;
    font-weight: 400;
}

.checkbox-group input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: var(--accent);
    cursor: pointer;
}

/* Login button */
.btn-login {
    width: 100%;
    padding: 12px;
    border: none;
    border-radius: var(--radius-xs);
    background: var(--accent);
    color: #171821;
    font-family: var(--font);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s;
    margin-top: 6px;
}

.btn-login:hover {
    background: #C2EAE5;
    box-shadow: 0 0 24px rgba(169, 223, 216, 0.3);
    transform: translateY(-1px);
}

.login-error {
    color: var(--danger);
    font-size: 12px;
    margin-top: 10px;
    min-height: 18px;
}

/* ═══ APP LAYOUT ═══ */
.app {
    display: flex;
    min-height: 100vh;
}

.hidden {
    display: none !important;
}

/* ═══ SIDEBAR ═══ */
.sidebar {
    width: var(--sidebar-width);
    background: var(--bg-sidebar);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    z-index: 100;
    transition: width 0.25s ease, transform 0.25s ease;
}

.sidebar-header {
    padding: 20px 16px;
    display: flex;
    align-items: center;
    gap: 10px;
    border-bottom: 1px solid var(--border);
}

.sidebar-logo-img {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    object-fit: cover;
    flex-shrink: 0;
}

.sidebar-title {
    font-size: 14px;
    font-weight: 700;
    color: var(--text-primary);
    -webkit-text-fill-color: var(--text-primary);
}

.sidebar-subtitle {
    font-size: 10px;
    color: var(--text-muted);
    display: block;
    margin-top: 1px;
}

/* Menu label */
.menu-label {
    font-size: 10px;
    font-weight: 600;
    color: var(--text-dim);
    text-transform: uppercase;
    letter-spacing: 1px;
    padding: 20px 16px 8px;
    display: block;
}

.sidebar-nav {
    flex: 1;
    padding: 0 10px;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 11px 14px;
    border-radius: var(--radius-sm);
    border: none;
    background: transparent;
    color: var(--text-secondary);
    font-family: var(--font);
    font-size: 14px;
    font-weight: 400;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: left;
    width: 100%;
    position: relative;
}

.nav-item:hover {
    background: rgba(169, 223, 216, 0.08);
    color: var(--text-primary);
}

.nav-item.active {
    background: var(--accent);
    color: #171821;
    font-weight: 600;
}

.nav-icon {
    font-size: 16px;
    width: 22px;
    text-align: center;
    opacity: 0.8;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: transform 0.25s ease;
}

.nav-icon svg {
    width: 18px;
    height: 18px;
}

.nav-item.active .nav-icon {
    opacity: 1;
}

/* Sidebar footer */
.sidebar-footer {
    padding: 12px;
    border-top: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 8px;
}

.user-icon {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--accent);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    color: #171821;
    font-weight: 600;
}

.user-name {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-primary);
}

.btn-logout {
    background: transparent;
    border: none;
    color: var(--text-dim);
    font-size: 14px;
    cursor: pointer;
    padding: 4px;
    transition: color 0.15s;
}

.btn-logout:hover {
    color: var(--text-primary);
}

/* ═══ MAIN ═══ */
.main-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* Topbar */
.topbar {
    height: var(--topbar-height);
    display: flex;
    align-items: center;
    padding: 0 24px;
    border-bottom: 1px solid var(--border);
    background: var(--bg-topbar);
    position: sticky;
    top: 0;
    z-index: 50;
    gap: 12px;
}

.btn-menu {
    display: none;
    background: transparent;
    border: 1px solid var(--border);
    border-radius: 6px;
    color: var(--text-primary);
    font-size: 16px;
    padding: 4px 8px;
    cursor: pointer;
}

.topbar-page-name {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
    flex: 1;
}

.topbar-actions {
    display: flex;
    align-items: center;
    gap: 16px;
}

.clock {
    font-size: 12px;
    color: var(--text-muted);
    font-weight: 400;
    white-space: nowrap;
}

.status-indicator {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 11px;
    font-weight: 500;
    color: var(--success);
    background: rgba(16, 185, 129, 0.1);
    border: 1px solid rgba(16, 185, 129, 0.2);
    padding: 4px 12px;
    border-radius: var(--radius-pill);
}

.status-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--success);
}

/* Pages */
.page {
    display: none;
    padding: 24px;
    position: relative;
}

.page.active {
    display: block;
}

/* Clean dashboard area — no aurora glow */

/* ═══ SECTION HEADER ═══ */
.section-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    margin-bottom: 24px;
}

.section-header h3 {
    font-size: 24px;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.2;
}

.section-actions {
    display: flex;
    gap: 8px;
}

/* ═══ STATS GRID ═══ */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    margin-bottom: 20px;
}

.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px;
    position: relative;
    overflow: hidden;
    transition: all 0.2s;
}

.stat-card:hover {
    border-color: var(--border-hover);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
}

/* Left color bar on stat cards */
.stat-card::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 3px;
}

.stat-total::before {
    background: var(--accent-gradient);
}

.stat-unlocked::before {
    background: var(--success);
}

.stat-locked::before {
    background: var(--danger);
}

.stat-offline::before {
    background: var(--offline);
}

.stat-icon {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    margin-bottom: 12px;
}

.stat-total .stat-icon {
    background: var(--mint-glow);
}

.stat-unlocked .stat-icon {
    background: var(--success-bg);
}

.stat-locked .stat-icon {
    background: var(--danger-bg);
}

.stat-offline .stat-icon {
    background: var(--offline-bg);
}

.stat-value {
    font-size: 36px;
    font-weight: 700;
    line-height: 1;
    margin-bottom: 4px;
}

.stat-label {
    font-size: 11px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
}

/* ═══ BUTTONS ═══ */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 8px 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius-xs);
    font-family: var(--font);
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.12s;
    background: var(--bg-card);
    color: var(--text-primary);
    white-space: nowrap;
}

.btn:hover {
    background: var(--bg-card-hover);
    border-color: var(--border-hover);
}

.btn-sm {
    padding: 6px 10px;
    font-size: 11px;
}

.btn-primary {
    background: var(--accent);
    border-color: transparent;
    color: #171821;
}

.btn-primary:hover {
    background: #C2EAE5;
    box-shadow: 0 0 20px rgba(169, 223, 216, 0.25);
}

.btn-secondary {
    background: var(--bg-input);
    border-color: var(--border);
    color: var(--text-secondary);
}

.btn-danger {
    background: var(--danger-bg);
    border-color: rgba(239, 68, 68, 0.2);
    color: var(--danger);
}

.btn-danger:hover {
    background: rgba(239, 68, 68, 0.18);
}

.btn-refresh {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text-secondary);
}

.btn-refresh:hover {
    border-color: var(--accent);
    color: var(--accent-light);
}

.btn-success {
    background: var(--success-bg);
    border-color: rgba(16, 185, 129, 0.2);
    color: var(--success);
}

.btn-warning {
    background: rgba(234, 179, 8, 0.12);
    border-color: rgba(234, 179, 8, 0.25);
    color: #facc15;
}

.btn-warning:hover {
    background: rgba(234, 179, 8, 0.22);
    border-color: rgba(234, 179, 8, 0.4);
}

/* ═══ TABLE ═══ */
.data-table-wrapper {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
}

.data-table th {
    padding: 12px 16px;
    font-size: 11px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-dim);
    text-align: left;
    border-bottom: 1px solid var(--border);
}

.data-table td {
    padding: 14px 16px;
    font-size: 13px;
    border-bottom: 1px solid var(--border);
    vertical-align: middle;
}

.data-table tr:last-child td {
    border-bottom: none;
}

.data-table tr:hover td {
    background: rgba(255, 255, 255, 0.02);
}

/* ═══ BOARD CARDS (Dashboard) ═══ */
.boards-grid {
    display: block;
}

.board-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 16px;
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    min-width: 100px;
    text-align: center;
    transition: border-color 0.15s;
}

.board-card:hover {
    border-color: var(--border-hover);
}

.board-card-actions {
    display: flex;
    gap: 4px;
    margin-top: 8px;
}

/* Status dot */
.board-status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    display: inline-block;
    margin-right: 4px;
}

.board-status-dot.unlocked {
    background: var(--success);
    box-shadow: 0 0 6px var(--success);
}

.board-status-dot.locked {
    background: var(--danger);
    box-shadow: 0 0 6px var(--danger);
}

.board-status-dot.offline {
    background: var(--offline);
}

/* Status badge pill */
.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 10px;
    border-radius: var(--radius-pill);
    font-size: 11px;
    font-weight: 500;
}

.status-badge.unlocked,
.status-badge.success {
    background: var(--success-bg);
    color: var(--success);
    border: 1px solid rgba(16, 185, 129, 0.2);
}

.status-badge.locked,
.status-badge.danger {
    background: var(--danger-bg);
    color: var(--danger);
    border: 1px solid rgba(239, 68, 68, 0.2);
}

.status-badge.offline {
    background: var(--offline-bg);
    color: var(--offline);
    border: 1px solid rgba(107, 114, 128, 0.2);
}

/* ═══ USER AVATAR ═══ */
.user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 600;
    color: white;
    flex-shrink: 0;
}

.user-avatar.admin {
    background: var(--accent);
}

.user-avatar.teacher {
    background: #f97316;
}

.user-avatar.viewer {
    background: #6b7280;
}

.user-role-badge {
    padding: 3px 10px;
    border-radius: var(--radius-pill);
    font-size: 11px;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    gap: 3px;
    border: 1px solid;
}

.user-role-badge.admin {
    background: var(--mint-glow);
    color: var(--mint);
    border-color: rgba(146, 254, 157, 0.2);
}

.user-role-badge.teacher {
    background: rgba(59, 130, 246, 0.1);
    color: #60a5fa;
    border-color: rgba(59, 130, 246, 0.2);
}

.user-role-badge.viewer {
    background: var(--offline-bg);
    color: var(--offline);
    border-color: rgba(107, 114, 128, 0.2);
}

/* ═══ GROUP CARDS ═══ */
.groups-list {
    display: block;
}

.group-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px;
    transition: border-color 0.15s;
}

.group-card:hover {
    border-color: var(--border-hover);
}

.group-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 10px;
}

.group-icon {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
}

.group-name {
    font-size: 15px;
    font-weight: 600;
}

.group-desc {
    font-size: 11px;
    color: var(--text-muted);
}

.group-stats {
    display: flex;
    gap: 16px;
    margin-bottom: 10px;
    font-size: 12px;
    color: var(--text-secondary);
}

.group-stat-item {
    display: flex;
    align-items: center;
    gap: 3px;
}

/* Progress bar */
.progress-bar-container {
    margin-bottom: 14px;
}

.progress-bar-label {
    display: flex;
    justify-content: space-between;
    font-size: 10px;
    font-weight: 500;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 4px;
}

.progress-bar {
    height: 4px;
    background: rgba(255, 255, 255, 0.06);
    border-radius: var(--radius-pill);
    overflow: hidden;
}

.progress-bar-fill {
    height: 100%;
    border-radius: var(--radius-pill);
    background: var(--danger);
    transition: width 0.3s;
}

.group-actions {
    display: flex;
    gap: 6px;
}

.group-actions .btn {
    flex: 1;
    justify-content: center;
}

/* ═══ ANNOUNCEMENTS ═══ */
.announcements-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.announcement-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 16px;
    display: flex;
    gap: 14px;
    transition: border-color 0.15s;
}

.announcement-card:hover {
    border-color: var(--border-hover);
}

.announcement-icon {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    background: var(--mint-glow);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    flex-shrink: 0;
}

.announcement-content {
    flex: 1;
}

.announcement-title {
    font-weight: 600;
    font-size: 13px;
    margin-bottom: 3px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.announcement-text {
    font-size: 12px;
    color: var(--text-secondary);
    margin-bottom: 6px;
    line-height: 1.4;
}

.announcement-meta {
    font-size: 11px;
    color: var(--text-dim);
    display: flex;
    align-items: center;
    gap: 8px;
}

.announcement-actions {
    display: flex;
    align-items: flex-start;
}

/* ═══ USERS ═══ */
.users-list {
    display: block;
}

/* ═══ MODALS ═══ */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 200;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
}

.modal-content {
    position: relative;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 24px;
    width: 90%;
    max-width: 460px;
    max-height: 90vh;
    overflow-y: auto;
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 18px;
}

.modal-header h3 {
    font-size: 16px;
    font-weight: 600;
}

.modal-close {
    background: transparent;
    border: 1px solid var(--border);
    border-radius: 6px;
    color: var(--text-muted);
    font-size: 14px;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.modal-close:hover {
    background: var(--danger-bg);
    color: var(--danger);
    border-color: rgba(239, 68, 68, 0.2);
}

.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    margin-top: 18px;
}

/* ═══ TOAST ═══ */
.toast {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 12px 20px;
    color: var(--text-primary);
    font-size: 13px;
    font-weight: 500;
    z-index: 500;
    box-shadow: var(--shadow-md);
    animation: slideUp 0.25s ease;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateX(-50%) translateY(16px);
    }

    to {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
}

.loading {
    text-align: center;
    padding: 32px;
    color: var(--text-muted);
    font-size: 13px;
}

/* ═══ RESPONSIVE ═══ */
@media (max-width:1024px) {
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width:768px) {
    .sidebar {
        transform: translateX(-100%);
        transition: transform 0.25s;
    }

    .sidebar.open {
        transform: translateX(0);
    }

    .main-content {
        margin-left: 0;
    }

    .btn-menu {
        display: block;
    }

    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .page {
        padding: 16px;
    }

    .section-header {
        flex-direction: column;
        gap: 10px;
    }
}

@media (max-width:480px) {
    .stats-grid {
        grid-template-columns: 1fr;
    }
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: rgba(169, 223, 216, 0.15);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(169, 223, 216, 0.25);
}

/* ═══ SIDEBAR COLLAPSE ═══ */
.sidebar {
    transition: width 0.25s ease;
}

.sidebar .nav-label,
.sidebar .sidebar-brand,
.sidebar .menu-label,
.sidebar .user-name {
    transition: opacity 0.2s ease;
}

.sidebar.collapsed {
    width: 72px;
}

.sidebar.collapsed .nav-label,
.sidebar.collapsed .sidebar-brand,
.sidebar.collapsed .menu-label {
    opacity: 0;
    width: 0;
    overflow: hidden;
    white-space: nowrap;
}

.sidebar.collapsed .sidebar-header {
    justify-content: center;
    padding: 20px 8px;
}

.sidebar.collapsed .nav-item {
    justify-content: center;
    padding: 12px;
    border-radius: 12px;
}

.sidebar.collapsed .nav-item.active {
    width: 48px;
    height: 48px;
    margin: 0 auto;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
}

.sidebar.collapsed .sidebar-nav {
    align-items: center;
    gap: 4px;
}

.sidebar.collapsed .nav-icon {
    margin: 0;
    font-size: 18px;
}

.sidebar.collapsed .sidebar-footer {
    flex-direction: column;
    gap: 8px;
    padding: 8px;
}

.sidebar.collapsed .user-info {
    justify-content: center;
}

.sidebar.collapsed .user-info>div {
    display: none;
}

.sidebar.collapsed .btn-logout {
    display: none;
}

.sidebar.collapsed~.main-content {
    margin-left: 72px;
}

.main-content {
    transition: margin-left 0.25s ease;
}

/* ═══ MOBILE RESPONSIVE ═══ */

/* Sidebar overlay backdrop */
.sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    z-index: 99;
}

.sidebar-overlay.active {
    display: block;
}

@media (max-width: 768px) {

    /* Sidebar → off-canvas overlay */
    .sidebar {
        transform: translateX(-100%);
        width: 240px;
        z-index: 200;
        box-shadow: var(--shadow-lg);
    }

    .sidebar.open {
        transform: translateX(0);
    }

    /* Collapsed state devre dışı mobildeyken */
    .sidebar.collapsed {
        width: 240px;
        transform: translateX(-100%);
    }

    .sidebar.collapsed.open {
        transform: translateX(0);
    }

    .sidebar.collapsed .nav-label,
    .sidebar.collapsed .sidebar-brand,
    .sidebar.collapsed .menu-label {
        opacity: 1;
        width: auto;
        overflow: visible;
    }

    .sidebar.collapsed .sidebar-header {
        justify-content: flex-start;
        padding: 16px 14px;
    }

    .sidebar.collapsed .nav-item {
        justify-content: flex-start;
        padding: 9px 12px;
    }

    .sidebar.collapsed .sidebar-footer {
        flex-direction: row;
        padding: 12px;
    }

    .sidebar.collapsed .user-info>div {
        display: block;
    }

    .sidebar.collapsed .btn-logout {
        display: block;
    }

    /* Main content full width */
    .main-content {
        margin-left: 0 !important;
    }

    /* Hamburger menu visible */
    .btn-menu {
        display: block;
    }

    /* Toggle button gizle mobildeyken */
    #btn-toggle-sidebar {
        display: none;
    }

    /* Page padding */
    .page {
        padding: 16px;
    }

    /* Topbar */
    .topbar {
        padding: 0 16px;
    }

    /* Stats grid 2 column */
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
    }

    .stat-value {
        font-size: 28px;
    }

    .stat-card {
        padding: 14px;
    }

    /* Section header stack */
    .section-header {
        flex-direction: column;
        gap: 12px;
    }

    .section-actions {
        width: 100%;
        flex-wrap: wrap;
    }

    /* Tables horizontal scroll */
    .data-table-wrapper {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .data-table {
        min-width: 600px;
    }

    /* Modal */
    .modal-content {
        width: 95% !important;
        max-width: 95% !important;
        max-height: 90vh;
        margin: 5vh auto;
    }

    /* Board cards */
    .board-card {
        min-width: 80px;
    }

    /* Duyuru & Mesaj 2-sütun → 1-sütun */
    #page-announcements>div[style*="grid-template-columns"] {
        grid-template-columns: 1fr !important;
    }

    /* Bulk board checkboxes */
    #bulk-board-checkboxes {
        grid-template-columns: 1fr !important;
    }
}

@media (max-width: 480px) {

    /* Stats 1 column */
    .stats-grid {
        grid-template-columns: 1fr;
    }

    .stat-value {
        font-size: 24px;
    }

    /* Login card */
    .login-card {
        margin: 16px;
        padding: 32px 24px;
    }

    /* Section header */
    .section-header h3 {
        font-size: 20px;
    }

    .topbar-actions .status-indicator span {
        display: none;
    }

    .clock {
        display: none;
    }
}