/* LOKAL Teacher Dashboard — Matches ClassPoint UI */

/* ===== AUTH SCREEN ===== */
.auth-screen {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
    padding: 20px;
}

/* ===== GROUP MANAGEMENT + EDITABLE PROFILE ===== */
.groups-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    margin-bottom: 24px;
}

.groups-toolbar h2 {
    margin: 0 0 4px;
    color: var(--text-dark);
    font-size: var(--font-2xl);
}

.groups-toolbar p {
    margin: 0;
    color: var(--text-secondary);
}

.groups-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
}

.group-card {
    --group-color: var(--primary);
    position: relative;
    min-height: 178px;
    overflow: hidden;
    padding: 22px;
    background: var(--bg-white);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    transition: transform .18s ease, box-shadow .18s ease;
}

.group-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.group-card-accent {
    position: absolute;
    inset: 0 0 auto;
    height: 5px;
    background: var(--group-color);
}

.group-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
    margin-bottom: 18px;
}

.group-card-header h3 {
    margin: 0 0 4px;
    color: var(--text-dark);
    font-size: var(--font-lg);
}

.group-card-header p,
.group-empty {
    margin: 0;
    color: var(--text-secondary);
    font-size: var(--font-sm);
}

.group-card-actions {
    display: flex;
    gap: 6px;
}

.icon-action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    padding: 0;
    border: 0;
    border-radius: 9px;
    background: #F3F6FA;
    color: var(--text-secondary);
    cursor: pointer;
}

.icon-action:hover {
    background: #E8EDFF;
    color: var(--primary);
}

.icon-action.danger:hover {
    background: #FEECEC;
    color: #DC3545;
}

.group-members {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.group-member-chip {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    min-height: 34px;
    padding: 4px 11px 4px 5px;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: #F8FAFD;
    color: var(--text-dark);
    font-size: var(--font-sm);
}

.member-initial {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: var(--group-color, #AAB5C5);
    color: white;
    font-size: 11px;
    font-weight: 700;
}

.ungrouped-card {
    --group-color: #AAB5C5;
    border-style: dashed;
}

.groups-first-hint {
    margin-top: 20px;
    padding: 14px 18px;
    border-radius: var(--radius-md);
    background: #F1F4FF;
    color: var(--primary);
    text-align: center;
    font-size: var(--font-sm);
}

.participant-group-select {
    min-width: 128px;
    height: 34px;
    padding: 0 30px 0 11px;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: #F8FAFD;
    color: var(--text-dark);
    font: inherit;
    cursor: pointer;
}

.group-form-modal {
    width: min(94vw, 470px);
}

.modal-subtitle {
    color: var(--text-secondary);
    font-size: 14px;
    margin: 5px 0 0;
}

.group-color-fieldset {
    border: 0;
    margin: 0 0 22px;
    padding: 0;
}

.group-color-fieldset legend {
    color: var(--text-primary);
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 10px;
}

.group-color-palette {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.group-color-choice {
    background: var(--choice-color);
    border: 3px solid #fff;
    border-radius: 50%;
    box-shadow: 0 0 0 1px var(--border);
    cursor: pointer;
    height: 34px;
    padding: 0;
    transition: transform .15s ease, box-shadow .15s ease;
    width: 34px;
}

.group-color-choice:hover {
    transform: translateY(-2px);
}

.group-color-choice.selected {
    box-shadow: 0 0 0 3px var(--choice-color);
    transform: scale(1.06);
}

.profile-avatar {
    overflow: hidden;
    flex: 0 0 auto;
}

.profile-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.profile-edit-form {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
}

.profile-edit-form label {
    display: flex;
    flex-direction: column;
    gap: 7px;
    color: var(--text-dark);
    font-size: var(--font-sm);
    font-weight: 600;
}

.profile-edit-form input {
    width: 100%;
    height: 44px;
    padding: 0 13px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--bg-white);
    color: var(--text-dark);
    font: inherit;
    transition: border-color .15s ease, box-shadow .15s ease;
}

.profile-edit-form input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(18, 84, 75, .12);
}

.profile-edit-form input:disabled {
    background: #F3F5F8;
    color: var(--text-secondary);
}

.profile-wide,
.profile-form-footer {
    grid-column: 1 / -1;
}

.profile-form-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-top: 6px;
    padding-top: 20px;
    border-top: 1px solid var(--border);
    color: var(--text-secondary);
    font-size: var(--font-sm);
}

@media (max-width: 720px) {
    .groups-toolbar,
    .profile-form-footer {
        align-items: stretch;
        flex-direction: column;
    }

    .profile-edit-form {
        grid-template-columns: 1fr;
    }

    .profile-wide,
    .profile-form-footer {
        grid-column: auto;
    }
}

.page-bg {
    position: fixed;
    inset: 0;
    z-index: 0;
}

.page-bg::before,
.page-bg::after {
    content: '';
    display: block;
    position: absolute;
    top: 0; right: 0; bottom: 0; left: 0;
    background: linear-gradient(170deg, #000 37%, #fff 45%),linear-gradient(46deg, #000 82%, #fff 97%),linear-gradient(134deg, #000 91%, #fff 109%),linear-gradient(108deg, #000 88%, #fff 98%),linear-gradient(120deg, #000 2%, #fff 8%),linear-gradient(164deg, #000 44%, #fff 62%),linear-gradient(136deg, #000 57%, #fff 72%),linear-gradient(85deg, #000 64%, #fff 65%),linear-gradient(40deg, #000 63%, #fff 77%),linear-gradient(153deg, #000 2%, #fff 13%),linear-gradient(100deg, #000 25%, #fff 35%),linear-gradient(33deg, #000 59%, #fff 65%),linear-gradient(102deg, #000 24%, #fff 41%),linear-gradient(115deg, #000 76%, #fff 91%),linear-gradient(130deg, #000 45%, #fff 53%),linear-gradient(74deg, #000 11%, #fff 14%),linear-gradient(37deg, #000 61%, #fff 73%),linear-gradient(49deg, #000 83%, #fff 92%),linear-gradient(126deg, #000 71%, #fff 79%),linear-gradient(152deg, #000 94%, #fff 95%),linear-gradient(153deg, #000 43%, #fff 59%),linear-gradient(155deg, #000 60%, #fff 80%),linear-gradient(160deg, #000 13%, #fff 18%),linear-gradient(54deg, #000 4%, #fff 24%),linear-gradient(155deg, #000 73%, #fff 89%),linear-gradient(136deg, #000 69%, #fff 83%),linear-gradient(107deg, #000 35%, #fff 42%),linear-gradient(93deg, #000 2%, #fff 8%),linear-gradient(87deg, #000 56%, #fff 57%),linear-gradient(159deg, #000 41%, #fff 56%),linear-gradient(92deg, #000 40%, #fff 56%),linear-gradient(100deg, #000 45%, #fff 56%),linear-gradient(117deg, #000 17%, #fff 37%),linear-gradient(139deg, #000 64%, #fff 66%),linear-gradient(57deg, #000 46%, #fff 52%),linear-gradient(115deg, #000 3%, #fff 23%),linear-gradient(115deg, #000 69%, #fff 75%),linear-gradient(161deg, #000 95%, #fff 110%),linear-gradient(132deg, #000 96%, #fff 116%),linear-gradient(177deg, #000 49%, #fff 57%);
    background-blend-mode: difference;
}

.page-bg::after {
    filter: invert(1);
    opacity: 0.5;
    top: 1px;
}

.page-bg-overlay {
    background: rgba(255, 255, 255, 0.96);
    position: absolute;
    top: 0; left: 0; bottom: 0; right: 0;
    z-index: 1;
}

.auth-card {
    position: relative;
    z-index: 10;
    background: var(--bg-white);
    border-radius: var(--radius-xl);
    padding: 40px;
    width: 100%;
    max-width: 420px;
    box-shadow: var(--shadow-xl);
    animation: fadeInUp 0.4s ease;
}

.auth-logo {
    text-align: center;
    margin-bottom: 8px;
}

.auth-logo .logo-icon {
    width: 64px;
    height: 64px;
    background: var(--primary);
    color: white;
    border-radius: var(--radius-full);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 12px;
}

.auth-logo h1 {
    font-size: var(--font-2xl);
    font-weight: 700;
    color: var(--text-primary);
}

.auth-subtitle {
    text-align: center;
    color: var(--text-secondary);
    margin-bottom: 32px;
    font-size: var(--font-sm);
}

.auth-form .form-group {
    margin-bottom: 20px;
}

.auth-form label {
    display: block;
    font-size: var(--font-sm);
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 6px;
}

.auth-form input {
    width: 100%;
    padding: 10px 14px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-md);
    font-size: var(--font-base);
    transition: border-color var(--transition-fast);
    background: var(--bg-white);
}

.auth-form input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(18, 84, 75, 0.1);
}

.auth-switch {
    text-align: center;
    font-size: var(--font-sm);
    color: var(--text-secondary);
    margin-top: 16px;
}

.auth-error {
    background: #fef2f2;
    color: var(--danger);
    padding: 10px 14px;
    border-radius: var(--radius-md);
    font-size: var(--font-sm);
    margin-top: 16px;
    text-align: center;
}

/* ===== DASHBOARD LAYOUT ===== */
.dashboard {
    display: flex;
    min-height: 100vh;
    position: relative;
    z-index: 10;
}

/* ===== SIDEBAR ===== */
.sidebar {
    width: var(--sidebar-width);
    background: var(--sidebar-bg);
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    z-index: 100;
    transition: width var(--transition-fast) ease;
}

.sidebar-logo {
    display: flex;
    align-items: center;
    gap: 12px;
    min-height: 88px;
    padding: 18px 18px 22px;
}

.sidebar-brand-logo {
    width: 48px;
    height: 48px;
    flex: 0 0 48px;
    object-fit: contain;
    border-radius: 14px;
    filter: drop-shadow(0 6px 12px rgba(0, 0, 0, 0.22));
}

.logo-icon-sm {
    width: 36px;
    height: 36px;
    background: var(--primary);
    color: white;
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    font-weight: 700;
}

.logo-text {
    color: white;
    font-size: 1.35rem;
    font-weight: 750;
    letter-spacing: 0.7px;
}

.sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 0 10px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    color: rgba(255, 255, 255, 0.75);
    border-radius: var(--radius-md);
    font-size: var(--font-sm);
    font-weight: 500;
    transition: all var(--transition-fast);
    text-decoration: none;
}

.nav-item:hover {
    background: var(--sidebar-hover);
    color: white;
    text-decoration: none;
}

.nav-item.active {
    background: var(--sidebar-active);
    color: white;
}

.nav-item svg {
    flex-shrink: 0;
    opacity: 0.85;
}

.nav-item.active svg {
    opacity: 1;
}

/* ===== MAIN CONTENT ===== */
.main-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    transition: margin-left var(--transition-fast) ease;
}

/* ===== HEADER ===== */
.header {
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    height: var(--header-height);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 24px;
    border-bottom: 1px solid rgba(0,0,0,0.05);
    position: sticky;
    top: 0;
    z-index: 50;
}

.header-left {
    position: absolute;
    left: 24px;
}

.menu-toggle-btn {
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 6px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background var(--transition-fast);
}

.menu-toggle-btn:hover {
    background: rgba(0,0,0,0.05);
    color: var(--primary);
}

.back-btn {
    background: none;
    border: none;
    color: var(--text-secondary);
    padding: 6px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    transition: color var(--transition-fast);
}

.back-btn:hover {
    color: var(--text-primary);
}

.header-title {
    font-size: var(--font-lg);
    font-weight: 600;
    color: var(--text-primary);
}

.header-right {
    position: absolute;
    right: 24px;
    display: flex;
    align-items: center;
}

.header-avatar {
    display: flex;
    align-items: center;
    gap: 4px;
    cursor: pointer;
    padding: 4px;
    border-radius: var(--radius-md);
}

.header-avatar:hover {
    background: var(--bg-main);
}

.avatar-circle {
    width: 32px;
    height: 32px;
    border-radius: var(--radius-full);
    background: var(--primary);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: var(--font-sm);
    font-weight: 600;
}

.user-menu {
    position: absolute;
    top: 100%;
    right: 0;
    background: var(--bg-white);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--border);
    min-width: 180px;
    overflow: hidden;
    z-index: 999;
    animation: fadeIn 0.15s ease;
}

.user-menu-header {
    padding: 12px 16px;
    border-bottom: 1px solid var(--border);
    font-size: var(--font-sm);
}

.user-menu-item {
    display: block;
    padding: 10px 16px;
    font-size: var(--font-sm);
    color: var(--text-primary);
    transition: background var(--transition-fast);
}

.user-menu-item:hover {
    background: var(--bg-main);
    text-decoration: none;
}

/* ===== PAGE CONTENT ===== */
.page-content {
    flex: 1;
    padding: 24px 32px;
    animation: fadeIn 0.2s ease;
}

/* ===== BUTTONS ===== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 9px 20px;
    font-size: var(--font-sm);
    font-weight: 500;
    border-radius: var(--radius-md);
    transition: all var(--transition-fast);
    white-space: nowrap;
}

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

.btn-primary:hover {
    background: var(--primary-hover);
    filter: brightness(1.18);
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.btn-primary:focus-visible {
    outline: 3px solid rgba(11, 31, 28, 0.28);
    outline-offset: 2px;
}

.nav-item:focus-visible {
    outline: 2px solid rgba(255, 255, 255, 0.72);
    outline-offset: -2px;
}

.btn-danger {
    background: var(--danger);
    color: white;
}

.btn-danger:hover {
    background: var(--danger-hover);
}

.btn-outline {
    background: transparent;
    color: var(--text-primary);
    border: 1.5px solid var(--border);
}

.btn-outline:hover {
    background: var(--bg-main);
    border-color: var(--text-muted);
}

.btn-ghost {
    background: transparent;
    color: var(--text-secondary);
}

.btn-ghost:hover {
    color: var(--text-primary);
}

.btn-full {
    width: 100%;
}

.btn-sm {
    padding: 6px 14px;
    font-size: var(--font-xs);
}

/* ===== CARDS ===== */
.card {
    background: var(--bg-white);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    padding: 20px;
    transition: box-shadow var(--transition-base);
}

.card:hover {
    box-shadow: var(--shadow-md);
}

/* ===== CLASS CARDS ===== */
.page-subtitle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
}

.page-subtitle p {
    color: var(--text-secondary);
    font-size: var(--font-sm);
}

.classes-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 16px;
}

.class-card {
    display: flex;
    align-items: center;
    gap: 16px;
    cursor: pointer;
}

.class-avatar {
    width: 56px;
    height: 56px;
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: var(--font-2xl);
    font-weight: 700;
    color: white;
    flex-shrink: 0;
}

.class-info h3 {
    font-size: var(--font-base);
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 2px;
}

.class-info .class-meta {
    font-size: var(--font-sm);
    color: var(--text-secondary);
    margin-bottom: 2px;
}

.class-info .class-code {
    font-size: var(--font-sm);
    color: var(--accent-teal);
    font-weight: 500;
}

/* ===== RESPONSIVE REPORTS TABLE ===== */
.report-table-wrapper {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    width: 100%;
}

.report-table-inner {
    min-width: 800px;
}

/* Grid layout for global reports (6 columns) */
.global-reports-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr 2fr 40px;
}

/* Grid layout for class reports (5 columns) */
.class-reports-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 2fr 40px;
}

/* ===== UNIFIED CP TABLE ===== */
.cp-table-container {
    background: white;
    border-radius: 8px;
    margin-top: 16px;
    margin-bottom: 32px;
}
.cp-table-header {
    background: #f4f5f6;
    border-radius: 8px 8px 0 0;
    padding: 16px 24px;
    font-weight: 600;
    color: #4b5563;
    font-size: 14px;
}
.cp-table-row {
    background: white;
    padding: 16px 24px;
    border-bottom: 1px solid #e5e7eb;
    align-items: center;
    transition: background 0.2s;
}
.cp-table-row:last-child {
    border-bottom: none;
    border-radius: 0 0 8px 8px;
}
.cp-table-row:hover {
    background: #f9fafb;
}

/* ===== PARTICIPANTS TABLE ===== */
.participants-table-wrapper {
    background: white;
    border-radius: var(--radius-md);
    overflow: hidden;
    margin-top: 16px;
    margin-bottom: 32px;
}

.participants-table-header {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr 40px;
    padding: 12px 24px;
    border-bottom: 1px solid var(--border);
    font-weight: 600;
    color: var(--text-primary);
    font-size: 14px;
}

.participants-row {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr 40px;
    padding: 12px 24px;
    border-bottom: 1px solid var(--border);
    align-items: center;
    transition: background 0.2s;
}

.participants-row:hover {
    background: var(--bg-main);
}

.participants-col {
    display: flex;
    align-items: center;
    font-size: 14px;
}

.sort-icon {
    margin-left: 4px;
    color: var(--text-muted);
}

.ungrouped-badge {
    background-color: #f1f5f9;
    color: var(--text-secondary);
    padding: 2px 10px;
    border-radius: var(--radius-full);
    font-size: 12px;
    font-weight: 500;
}

.star-controls {
    display: none;
    align-items: center;
    gap: 8px;
}

.cp-table-row:hover .star-controls {
    display: flex;
}

.cp-table-row:hover .star-display-only {
    display: none;
}

.star-btn {
    width: 20px;
    height: 20px;
    border-radius: 4px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 14px;
    font-weight: bold;
    cursor: pointer;
    border: none;
}

.star-btn.minus {
    background-color: #ef4444;
}

.star-btn.minus:hover {
    background-color: #dc2626;
}

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

.star-btn.plus:hover {
    background-color: var(--primary-hover);
}

/* ===== CLASS DETAIL ===== */
.class-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 4px;
}

.class-header h2 {
    font-size: var(--font-lg);
    font-weight: 600;
}

.class-code-badge {
    background: var(--primary);
    color: white;
    padding: 2px 10px;
    border-radius: var(--radius-md);
    font-size: var(--font-xs);
    font-weight: 600;
}

.tabs {
    display: flex;
    gap: 0;
    border-bottom: 1px solid var(--border);
    margin-bottom: 32px;
    overflow-x: auto;
    white-space: nowrap;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}

.tabs::-webkit-scrollbar {
    display: none;
}

.tab {
    padding: 12px 20px;
    font-size: var(--font-sm);
    font-weight: 500;
    color: var(--text-secondary);
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    cursor: pointer;
    transition: all var(--transition-fast);
    flex-shrink: 0;
}



.tab:hover {
    color: var(--text-primary);
}

.tab.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
}

/* Class settings sections */
.settings-section {
    margin-bottom: 32px;
    padding-bottom: 32px;
    border-bottom: 1px solid var(--border);
}

.settings-section:last-child {
    border-bottom: none;
}

.settings-section h3 {
    font-size: var(--font-base);
    font-weight: 600;
    margin-bottom: 6px;
}

.settings-section p {
    font-size: var(--font-sm);
    color: var(--text-secondary);
    margin-bottom: 12px;
}

/* ===== EMPTY STATES ===== */
.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 80px 20px;
    text-align: center;
}

.empty-state .empty-icon {
    font-size: 56px;
    margin-bottom: 16px;
    line-height: 1;
}

.empty-state .empty-icon.gradient-icon {
    width: 64px;
    height: 64px;
    background: linear-gradient(135deg, var(--brand-500), var(--primary));
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    margin-bottom: 16px;
}

.empty-state h3 {
    font-size: var(--font-lg);
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.empty-state p {
    font-size: var(--font-sm);
    color: var(--text-secondary);
    max-width: 400px;
    line-height: 1.6;
}

.empty-state .btn {
    margin-top: 20px;
}

/* ===== MODAL ===== */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    animation: fadeIn 0.15s ease;
}

.modal {
    background: var(--bg-white);
    border-radius: var(--radius-lg);
    padding: 28px;
    width: 90%;
    max-width: 480px;
    box-shadow: var(--shadow-xl);
    animation: fadeInUp 0.2s ease;
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
}

.modal-header h2 {
    font-size: var(--font-lg);
    font-weight: 600;
}

.modal-close {
    background: none;
    border: none;
    font-size: 24px;
    color: var(--text-secondary);
    padding: 4px;
    line-height: 1;
}

.modal-close:hover {
    color: var(--text-primary);
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    font-size: var(--font-sm);
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.form-group input,
.form-group select {
    width: 100%;
    padding: 10px 0;
    border: none;
    border-bottom: 1.5px solid var(--border);
    font-size: var(--font-base);
    color: var(--text-primary);
    background: transparent;
    transition: border-color var(--transition-fast);
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-bottom-color: var(--primary);
}

.form-group input::placeholder {
    color: var(--text-muted);
}

.avatar-picker {
    display: flex;
    align-items: center;
    gap: 16px;
}

.avatar-preview {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: var(--font-xl);
    font-weight: 700;
}

.modal-actions {
    display: flex;
    gap: 12px;
    margin-top: 28px;
}

/* ===== FILTER BAR ===== */
.filter-bar {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 24px;
}

.filter-bar label {
    font-size: var(--font-sm);
    font-weight: 600;
    color: var(--text-primary);
}

.filter-bar select {
    padding: 8px 12px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-md);
    font-size: var(--font-sm);
    color: var(--text-primary);
    background: var(--bg-white);
    cursor: pointer;
}

/* ===== SETTINGS - STAR LEVELS ===== */
.settings-tabs {
    display: flex;
    gap: 0;
    border-bottom: 1px solid var(--border);
    margin-bottom: 24px;
}

.settings-description {
    font-size: var(--font-sm);
    color: var(--text-secondary);
    margin-bottom: 24px;
    line-height: 1.6;
}

.levels-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 16px;
    margin-bottom: 24px;
}

.level-card {
    background: var(--bg-white);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 20px 12px;
    text-align: center;
    transition: box-shadow var(--transition-base);
}

.level-card:hover {
    box-shadow: var(--shadow-sm);
}

.level-card h4 {
    font-size: var(--font-sm);
    font-weight: 600;
    margin-bottom: 12px;
    color: var(--text-primary);
}

.level-badge {
    width: 56px;
    height: 56px;
    margin: 0 auto 12px;
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: var(--font-xl);
    font-weight: 700;
    color: white;
}

.level-stars {
    font-size: var(--font-sm);
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
}

.level-stars .star {
    color: var(--warning);
}

.level-stars-input {
    width: 60px;
    padding: 4px;
    border: 1px solid var(--primary);
    border-radius: var(--radius-sm);
    text-align: center;
    font-size: var(--font-sm);
    color: var(--text-primary);
    outline: none;
}

.level-stars-input:focus {
    box-shadow: 0 0 0 2px var(--primary-light);
}

.level-card.deletable {
    position: relative;
}

.level-delete-btn {
    position: absolute;
    top: -8px;
    right: -8px;
    width: 20px;
    height: 20px;
    background: var(--danger);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    cursor: pointer;
    box-shadow: var(--shadow-sm);
    border: 2px solid white;
}

/* ===== PARTICIPANT LIST ===== */
.participant-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.participant-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: var(--bg-white);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
}

.participant-avatar {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-full);
    background: var(--primary-light);
    color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: var(--font-sm);
}

.participant-info {
    flex: 1;
}

.participant-info h4 {
    font-size: var(--font-sm);
    font-weight: 600;
}

.participant-info p {
    font-size: var(--font-xs);
    color: var(--text-secondary);
}

.participant-stars {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: var(--font-sm);
    font-weight: 600;
    color: var(--warning);
}

/* ===== LEADERBOARD ===== */
.leaderboard {
    max-width: 600px;
}

.leaderboard-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    background: var(--bg-white);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    margin-bottom: 8px;
}

.leaderboard-rank {
    width: 32px;
    height: 32px;
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: var(--font-sm);
}

.leaderboard-rank.gold { background: #fef3c7; color: #b45309; }
.leaderboard-rank.silver { background: #f1f5f9; color: #475569; }
.leaderboard-rank.bronze { background: #fed7aa; color: #c2410c; }
.leaderboard-rank.default { background: var(--bg-main); color: var(--text-secondary); }

/* ===== TOAST ===== */
.toast-container {
    position: fixed;
    top: 24px;
    right: 24px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.toast {
    background: var(--text-primary);
    color: white;
    padding: 12px 20px;
    border-radius: var(--radius-md);
    font-size: var(--font-sm);
    box-shadow: var(--shadow-lg);
    animation: slideInRight 0.3s ease;
    max-width: 360px;
}

.toast.success { background: var(--success); }
.toast.error { background: var(--danger); }

/* ===== ACTIVITY CARDS ===== */
.activities-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 24px;
}

.activity-card {
    display: flex;
    flex-direction: column;
    background: var(--bg-white);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}

.activity-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.activity-card-img-wrapper {
    height: 180px;
    background: #f3f4f6;
    display: flex;
    align-items: center;
    justify-content: center;
    border-bottom: 1px solid var(--border);
    position: relative;
}

.activity-card-img-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.activity-icon-fallback {
    font-size: 48px;
    color: var(--text-secondary);
    opacity: 0.5;
}

.activity-card-footer {
    padding: 16px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: #ffffff;
}

.activity-card-type {
    font-size: 15px;
    color: #111827;
    font-weight: 500;
}

.activity-card-actions {
    display: flex;
    align-items: center;
    gap: 16px;
    color: #6B7280;
    font-size: 15px;
}

.activity-card-action {
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    transition: color 0.2s;
}

.activity-card-action:hover {
    color: var(--primary);
}

.activity-card-action.favorite:hover {
    color: var(--danger);
}

.activity-card-action.favorite.active {
    color: var(--danger);
}


/* ===== REPORTS TABLE ===== */
.reports-container {
    max-width: 900px;
    margin: 0 auto;
}

.report-month-badge {
    background: var(--bg-main);
    color: var(--text-secondary);
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 6px 12px;
    border-radius: var(--radius-full);
    display: inline-block;
    margin: 32px auto 16px;
    text-align: center;
}

.report-month-wrapper {
    text-align: center;
}

.report-table-wrapper {
    background: var(--bg-white);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
}

.report-table-header {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr 1.5fr;
    background: #F8FAFC;
    padding: 12px 24px;
    font-size: 13px;
    font-weight: 700;
    color: var(--text-dark);
    border-bottom: 1px solid var(--border);
}

.report-row {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr 1.5fr;
    padding: 16px 24px;
    border-bottom: 1px solid var(--border);
    align-items: center;
    font-size: var(--font-sm);
    color: var(--text-dark);
    cursor: pointer;
    transition: background 0.2s;
}

.report-row:last-child {
    border-bottom: none;
}

.report-row:hover {
    background: #F1F5F9;
}

.report-col {
    display: flex;
    align-items: center;
    gap: 8px;
}

.report-col.time {
    color: var(--text-secondary);
}

.report-col.stars {
    color: var(--warning);
    font-weight: 600;
}

.top-player-avatar {
    width: 24px;
    height: 24px;
    border-radius: var(--radius-full);
    background: var(--primary);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    font-weight: 700;
}

/* Detailed Report Table */
.detail-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 24px;
}

.detail-table th {
    text-align: left;
    padding: 12px 16px;
    font-size: 12px;
    text-transform: uppercase;
    color: var(--text-secondary);
    border-bottom: 1px solid var(--border);
    background: #F8FAFC;
}

.detail-table td {
    padding: 16px;
    border-bottom: 1px solid var(--border);
    font-size: var(--font-sm);
}

.detail-table tr:last-child td {
    border-bottom: none;
}

/* ===== ACCOUNT PAGE ===== */
.profile-card {
    background: var(--bg-white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    padding: 32px;
    min-width: 0;
    border: 1px solid var(--border);
}

.account-layout {
    width: min(1120px, 100%);
    margin: 0 auto;
    display: grid;
    grid-template-columns: minmax(0, 1.05fr) minmax(360px, 0.95fr);
    gap: 24px;
    align-items: start;
}

.profile-avatar {
    overflow: hidden;
}

.profile-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.devices-card {
    background: var(--bg-white);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    padding: 28px;
}

.devices-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 20px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--border);
}

.devices-header h2 {
    margin: 0 0 6px;
    color: var(--text-dark);
    font-size: var(--font-xl);
}

.devices-header p {
    margin: 0;
    color: var(--text-secondary);
    font-size: var(--font-sm);
    line-height: 1.5;
}

.devices-count,
.current-device-badge {
    flex: none;
    border-radius: 999px;
    background: rgba(11, 31, 28, 0.08);
    color: #0B1F1C;
    font-size: 12px;
    font-weight: 700;
    padding: 6px 10px;
}

.devices-list {
    display: flex;
    flex-direction: column;
}

.device-row {
    display: grid;
    grid-template-columns: 44px minmax(0, 1fr) auto auto;
    gap: 14px;
    align-items: center;
    min-height: 78px;
    padding: 16px 0;
    border-bottom: 1px solid var(--border);
}

.device-row:last-child {
    border-bottom: 0;
    padding-bottom: 0;
}

.device-row.is-revoked {
    opacity: 0.62;
}

.device-icon {
    width: 44px;
    height: 44px;
    display: grid;
    place-items: center;
    border-radius: 13px;
    background: #F0F5F4;
    color: #0B1F1C;
}

.device-icon svg {
    width: 24px;
    height: 24px;
}

.device-icon span {
    font-size: 20px;
    font-weight: 800;
}

.device-details {
    min-width: 0;
}

.device-name {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    color: var(--text-dark);
    font-size: var(--font-md);
    font-weight: 700;
}

.current-device-badge {
    padding: 3px 8px;
    font-size: 10px;
}

.device-meta {
    margin-top: 5px;
    color: var(--text-secondary);
    font-size: 12px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.device-status {
    color: var(--text-secondary);
    font-size: 12px;
    font-weight: 700;
}

.device-status.active {
    color: #17745F;
}

.device-revoke {
    border: 1px solid #D7E1DF;
    border-radius: 9px;
    background: white;
    color: #A53434;
    padding: 8px 11px;
    font: inherit;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
}

.device-revoke:hover {
    border-color: #E5AAAA;
    background: #FFF7F7;
}

.device-revoke:disabled {
    cursor: wait;
    opacity: 0.6;
}

.devices-empty {
    padding: 28px 0 4px;
    color: var(--text-secondary);
    text-align: center;
}

@media (max-width: 960px) {
    .account-layout {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 600px) {
    .profile-card,
    .devices-card {
        padding: 22px;
    }

    .device-row {
        grid-template-columns: 44px minmax(0, 1fr) auto;
    }

    .device-status {
        display: none;
    }
}

.profile-header {
    display: flex;
    align-items: center;
    gap: 24px;
    margin-bottom: 32px;
    padding-bottom: 24px;
    border-bottom: 1px solid var(--border);
}

.profile-avatar {
    width: 80px;
    height: 80px;
    border-radius: var(--radius-full);
    background: var(--primary);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 32px;
    font-weight: 700;
}

.profile-title h2 {
    font-size: var(--font-2xl);
    font-weight: 700;
    color: var(--text-dark);
    margin-bottom: 4px;
}

.profile-title p {
    color: var(--text-secondary);
    font-size: var(--font-sm);
}

.profile-info-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 20px;
}

.profile-stat {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.profile-stat label {
    font-size: 11px;
    text-transform: uppercase;
    font-weight: 700;
    color: var(--text-secondary);
    letter-spacing: 0.5px;
}

.profile-stat span {
    font-size: var(--font-md);
    font-weight: 500;
    color: var(--text-dark);
}

/* ===== ACTIVITIES GRID ===== */
#activities-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 24px;
    margin-top: 24px;
}


/* ===== CUSTOM CONFIRM MODAL ===== */
.custom-modal-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.4);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    padding: 20px;
}

.custom-modal {
    background: white;
    border-radius: var(--radius-lg);
    padding: 24px;
    width: 100%;
    max-width: 400px;
    box-shadow: var(--shadow-xl);
    animation: fadeInUp 0.2s ease-out;
}

.custom-modal h2 {
    font-size: var(--font-xl);
    font-weight: 700;
    color: var(--text-dark);
    margin-bottom: 12px;
}

.custom-modal p {
    font-size: var(--font-md);
    color: var(--text-secondary);
    margin-bottom: 24px;
    line-height: 1.5;
}

.custom-modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
}

.custom-modal-actions .btn {
    padding: 8px 16px;
}

/* ===== ANIMATIONS ===== */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(16px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes slideInRight {
    from { opacity: 0; transform: translateX(40px); }
    to { opacity: 1; transform: translateX(0); }
}

/* ===== RESPONSIVE ===== */
/* Collapsed Sidebar Logic (Desktop) */
@media (min-width: 769px) {
    .dashboard.sidebar-toggled .sidebar { width: 60px; }
    .dashboard.sidebar-toggled .sidebar .logo-text, 
    .dashboard.sidebar-toggled .sidebar .nav-item span { display: none; }
    .dashboard.sidebar-toggled .sidebar-logo { justify-content: center; padding: 16px 8px; }
    .dashboard.sidebar-toggled .sidebar-brand-logo { width: 40px; height: 40px; flex-basis: 40px; }
    .dashboard.sidebar-toggled .nav-item { justify-content: center; padding: 12px; }
    .dashboard.sidebar-toggled .main-content { margin-left: 60px; }
}

@media (max-width: 768px) {
    .levels-grid { grid-template-columns: repeat(2, 1fr); }
    .page-content { padding: 16px; }
}

.level-badge svg { width: 100%; height: 100%; }

/* ========== HYBRID SERVER ========== */
.server-page { width: min(1240px, 100%); margin: 0 auto; }
.server-hero {
    position: relative; overflow: hidden; display: flex; align-items: flex-start;
    justify-content: space-between; gap: 32px; padding: 34px 36px; border-radius: 22px;
    color: #fff; background: radial-gradient(circle at 87% 12%, rgba(255,255,255,.12) 0 76px, transparent 77px), linear-gradient(135deg, #0B1F1C 0%, #123B35 100%);
    box-shadow: 0 16px 34px rgba(11,31,28,.16);
}
.server-hero > div:first-child { max-width: 720px; }
.server-eyebrow { display: block; margin-bottom: 9px; color: #A7E1D3; font-size: 11px; font-weight: 800; letter-spacing: .13em; }
.server-hero h2 { margin: 0 0 10px; color: #fff; font-size: 30px; line-height: 1.2; }
.server-hero p { margin: 0; color: rgba(255,255,255,.76); font-size: 15px; line-height: 1.65; }
.server-live-pill { display: inline-flex; align-items: center; gap: 9px; flex: none; padding: 10px 14px; border: 1px solid rgba(255,255,255,.18); border-radius: 999px; background: rgba(255,255,255,.09); font-size: 13px; font-weight: 700; }
.server-live-pill > span, .status-dot { width: 9px; height: 9px; border-radius: 50%; background: #35D39A; box-shadow: 0 0 0 5px rgba(53,211,154,.15); }
.server-loading { margin-top: 20px; padding: 42px; border: 1px solid var(--border); border-radius: 18px; color: var(--text-secondary); text-align: center; background: #fff; }
.server-restart-notice { display: flex; align-items: center; gap: 14px; margin-top: 20px; padding: 15px 18px; border: 1px solid #F1D59A; border-radius: 14px; color: #77520C; background: #FFF9E9; }
.server-restart-notice svg { flex: none; }
.server-restart-notice strong, .server-restart-notice span { display: block; }
.server-restart-notice span { margin-top: 3px; font-size: 13px; color: #8A6A29; }
.server-status-grid { display: grid; grid-template-columns: .8fr 1.1fr 1.1fr; gap: 14px; margin-top: 20px; }
.server-status-card { min-width: 0; padding: 18px 20px; border: 1px solid var(--border); border-radius: 16px; background: #fff; box-shadow: 0 8px 20px rgba(24,42,39,.055); }
.server-status-card > span, .server-status-card div > span { display: block; margin-bottom: 7px; color: var(--text-muted); font-size: 11px; font-weight: 750; letter-spacing: .04em; text-transform: uppercase; }
.server-status-primary { display: flex; align-items: center; gap: 14px; }
.server-status-primary strong { font-size: 18px; color: var(--text-primary); }
.server-status-icon { display: grid; place-items: center; width: 42px; height: 42px; flex: none; border-radius: 13px; background: #EAF7F3; }
.server-url { display: block; width: 100%; overflow: hidden; padding: 0; border: 0; color: var(--primary); background: transparent; font: inherit; font-size: 14px; font-weight: 700; text-align: left; text-overflow: ellipsis; white-space: nowrap; cursor: pointer; }
.server-url:hover { text-decoration: underline; }
.server-config-panel { margin-top: 20px; padding: 28px; border: 1px solid var(--border); border-radius: 20px; background: #fff; box-shadow: 0 10px 28px rgba(24,42,39,.055); }
.server-section-heading h3 { margin: 0 0 5px; font-size: 20px; }
.server-section-heading p { margin: 0; color: var(--text-secondary); font-size: 14px; }
.server-mode-grid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 14px; margin-top: 20px; }
.server-mode-card { position: relative; min-height: 190px; padding: 20px; border: 1px solid #DCE4E2; border-radius: 16px; color: var(--text-primary); background: #FCFDFD; font: inherit; text-align: left; cursor: pointer; transition: border-color .18s ease, box-shadow .18s ease, transform .18s ease, background .18s ease; }
.server-mode-card:hover { transform: translateY(-2px); border-color: #9AB9B1; }
.server-mode-card.selected { border-color: #0B1F1C; background: #F4FAF8; box-shadow: 0 0 0 3px rgba(11,31,28,.08), 0 9px 24px rgba(11,31,28,.09); }
.server-mode-check { position: absolute; top: 18px; right: 18px; display: grid; place-items: center; width: 20px; height: 20px; border: 1px solid #AEBDB9; border-radius: 50%; background: #fff; }
.server-mode-card.selected .server-mode-check { border-color: #0B1F1C; background: #0B1F1C; }
.server-mode-card.selected .server-mode-check span { width: 7px; height: 7px; border-radius: 50%; background: #fff; }
.server-mode-title { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; padding-right: 26px; }
.server-mode-title strong { font-size: 17px; }
.server-mode-title em { padding: 4px 8px; border-radius: 999px; color: #0B1F1C; background: #DFF2EC; font-size: 9px; font-style: normal; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; }
.server-mode-scope { display: block; margin-top: 22px; color: var(--primary); font-size: 12px; font-weight: 800; }
.server-mode-card p { margin: 9px 0 0; color: var(--text-secondary); font-size: 13px; line-height: 1.55; }
.server-fields { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 18px; margin-top: 26px; padding-top: 24px; border-top: 1px solid var(--border); }
.server-field > span { display: block; margin-bottom: 8px; color: var(--text-primary); font-size: 13px; font-weight: 750; }
.server-field input { width: 100%; height: 46px; padding: 0 14px; border: 1px solid #CBD8D4; border-radius: 11px; color: var(--text-primary); background: #fff; font: inherit; outline: none; }
.server-field input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(11,31,28,.1); }
.server-field input[readonly] { color: var(--text-secondary); background: #F5F7F7; }
.server-field small { display: block; margin-top: 7px; color: var(--text-muted); font-size: 11px; line-height: 1.45; }
.server-public-field { grid-column: 1 / -1; }
.server-address-preview { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-top: 20px; }
.server-address-preview > div { min-width: 0; padding: 16px 18px; border-radius: 13px; background: #F5F8F7; }
.server-address-preview span, .server-address-preview strong { display: block; }
.server-address-preview > div > span:first-child { margin-bottom: 5px; color: var(--text-muted); font-size: 11px; font-weight: 750; text-transform: uppercase; }
.server-address-preview > div > strong { overflow-wrap: anywhere; font-size: 13px; }
.server-privacy-note strong { margin-bottom: 4px; color: #0B1F1C; }
.server-privacy-note span { color: var(--text-secondary); font-size: 12px; line-height: 1.45; }
.server-sync-panel { margin-top: 20px; padding: 20px; border: 1px solid #D7E3E0; border-radius: 16px; background: linear-gradient(145deg,#F8FBFA,#F1F7F5); }
.server-sync-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; }
.server-sync-kicker { display: block; margin-bottom: 5px; color: var(--primary); font-size: 10px; font-weight: 850; letter-spacing: .11em; }
.server-sync-heading h3 { margin: 0 0 5px; font-size: 18px; }
.server-sync-heading p { margin: 0; color: var(--text-secondary); font-size: 12px; line-height: 1.5; overflow-wrap: anywhere; }
.server-sync-state { display: inline-flex; align-items: center; gap: 8px; flex: none; padding: 8px 11px; border-radius: 999px; color: #285047; background: #E4F2EE; font-size: 11px; font-weight: 800; }
.server-sync-state i { width: 8px; height: 8px; border-radius: 50%; background: #2CB67D; }
.server-sync-attention .server-sync-state { color: #8A4B12; background: #FFF0DD; }
.server-sync-attention .server-sync-state i { background: #E8892E; }
.server-sync-disabled .server-sync-state { color: #5F6D69; background: #E9EEEC; }
.server-sync-disabled .server-sync-state i { background: #91A09C; }
.server-sync-metrics { display: grid; grid-template-columns: .65fr .65fr .65fr 1.55fr; gap: 10px; margin-top: 16px; }
.server-sync-metrics > div { min-width: 0; padding: 13px 14px; border: 1px solid #E0E8E6; border-radius: 12px; background: rgba(255,255,255,.82); }
.server-sync-metrics span { display: block; margin-bottom: 5px; color: var(--text-muted); font-size: 10px; font-weight: 750; text-transform: uppercase; }
.server-sync-metrics strong { display: block; overflow-wrap: anywhere; color: var(--text-primary); font-size: 15px; }
.server-sync-error { margin-top: 12px; padding: 10px 12px; border-radius: 10px; color: #982E2E; background: #FFF0F0; font-size: 12px; overflow-wrap: anywhere; }
.server-sync-button { margin-top: 14px; }
.server-actions { display: flex; align-items: center; gap: 16px; margin-top: 24px; }
.server-actions #server-save-note { color: var(--text-muted); font-size: 12px; }
@media (max-width: 980px) {
    .server-status-grid { grid-template-columns: 1fr 1fr; }
    .server-status-primary { grid-column: 1 / -1; }
    .server-mode-grid { grid-template-columns: 1fr; }
    .server-mode-card { min-height: 0; }
}
@media (max-width: 680px) {
    .server-hero { padding: 26px 24px; flex-direction: column; }
    .server-hero h2 { font-size: 25px; }
    .server-status-grid, .server-fields, .server-address-preview { grid-template-columns: 1fr; }
    .server-sync-heading { flex-direction: column; }
    .server-sync-metrics { grid-template-columns: 1fr 1fr; }
    .server-status-primary, .server-public-field { grid-column: auto; }
    .server-config-panel { padding: 20px; }
    .server-actions { align-items: stretch; flex-direction: column; }
    .server-actions .btn { width: 100%; }
}

/* ========== PARTICIPANT STAR STYLES ========== */
.star-display-only {
    display: flex;
    gap: 6px;
    align-items: center;
    min-height: 32px;
}
.star-controls {
    display: none;
    align-items: center;
    gap: 8px;
    min-height: 32px;
}
.participant-star-icon {
    width: 24px;
    height: 24px;
    min-width: 24px;
    max-width: 24px;
    max-height: 24px;
    flex: 0 0 24px;
    display: block;
    box-sizing: border-box;
}
.participants-row:hover .star-controls {
    display: flex !important;
}
.participants-row:hover .star-display-only {
    display: none !important;
}
.star-btn {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    border: none;
    color: white;
    font-size: 18px;
    font-weight: bold;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.2s;
}
.star-btn:hover {
    opacity: 0.8;
}
.star-btn.minus {
    background-color: #E03530; /* LOKAL red */
}
.star-btn.plus {
    background-color: var(--primary);
}
.star-anim-text {
    color: #10B981; /* Green text for (+1) */
    font-weight: 600;
    margin-left: 4px;
}
.sortable-col {
    cursor: pointer;
    user-select: none;
}
.sortable-col:hover {
    color: var(--primary);
}

/* 3-DOTS DROPDOWN MENU */
.participant-menu-btn {
    background: none;
    border: none;
    font-size: 20px;
    color: var(--text-muted);
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 4px;
}
.participant-menu-btn:hover {
    background-color: var(--bg-light);
    color: var(--text-primary);
}
.dropdown-container {
    position: relative;
}
.dropdown-menu {
    position: absolute;
    right: 0;
    top: 100%;
    background: white;
    border: 1px solid var(--border);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    border-radius: 6px;
    z-index: 50;
    min-width: 150px;
    padding: 4px 0;
    display: none;
}
.dropdown-menu.show {
    display: block;
}
.dropdown-item {
    display: block;
    width: 100%;
    text-align: left;
    padding: 8px 16px;
    font-size: 14px;
    color: var(--text-primary);
    background: none;
    border: none;
    cursor: pointer;
    white-space: nowrap;
}
.dropdown-item:hover {
    background-color: var(--bg-light);
}
.dropdown-item.text-danger {
    color: #ef4444;
}

/* ===== MOBILE RESPONSIVENESS ===== */
@media (max-width: 1024px) {
    /* Prevent X/Y overlapping and scrolling */
    html, body {
        overflow-x: hidden;
        width: 100%;
        height: 100%;
    }
    .dashboard {
        flex-direction: column;
        overflow-x: hidden;
    }
    
    /* Move sidebar to bottom */
    .sidebar {
        top: auto;
        bottom: 0;
        left: 0;
        right: 0;
        width: 100%;
        height: 64px;
        flex-direction: row;
        border-right: none;
        border-top: 1px solid var(--border);
        padding: 0;
        z-index: 1000;
        background: white; /* Bottom bar bg */
        transform: none !important;
    }
    
    /* Hide LOKAL logo in bottom bar */
    .sidebar-logo {
        display: none;
    }
    
    /* Adjust nav items for bottom bar */
    .sidebar-nav {
        flex-direction: row;
        justify-content: space-around;
        align-items: center;
        width: 100%;
        padding: 0;
        margin: 0;
        height: 100%;
    }
    
    .nav-item {
        display: flex;
        flex-direction: column;
        justify-content: center;
        align-items: center;
        width: 44px;
        height: 44px;
        padding: 0;
        border-radius: 10px;
        flex: none;
        color: var(--text-muted);
    }
    
    .nav-item span {
        display: none; /* Hide text, only show icons */
    }
    
    .nav-item:hover {
        background: transparent;
        color: var(--primary);
    }
    
    .nav-item.active {
        background: var(--primary);
        color: white;
    }
    
    .nav-item.active svg {
        stroke: white; /* White icon for active state */
        fill: transparent;
    }
    
    .nav-item svg {
        opacity: 1; /* Remove desktop opacity fading */
    }
    
    /* Adjust main content */
    .main-content {
        margin-left: 0 !important;
        padding-bottom: 64px; /* Space for bottom bar */
        width: 100%;
        min-height: 100vh;
    }
    
    /* Header adjustments */
    .header {
        padding: 0 16px;
    }
    
    /* Hide hamburger menu toggle */
    .menu-toggle-btn {
        display: none !important;
    }
    
    /* Show mobile logo instead in header left */
    .mobile-header-logo {
        display: block !important;
        width: 40px;
        height: 40px;
        border-radius: 12px;
        filter: drop-shadow(0 4px 9px rgba(11, 31, 28, 0.20));
    }
    
    /* Adjust grid layouts */
    .classes-grid {
        grid-template-columns: 1fr;
    }
    
    .reports-table {
        display: block;
        overflow-x: auto;
    }
    
    .page-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 16px;
    }
    
    .header-right {
        margin-left: auto;
    }
}
