* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Open Sans', Arial, sans-serif;
    background-color: #fcfcfc;
    color: #333;
}

/* --- LOGIN PAGE --- */
.login-body {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
    background: #e9ecef;
}

.login-container {
    background: white;
    padding: 40px;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    width: 350px;
    text-align: center;
}

.logo-area h1 {
    font-size: 24px;
    font-family: serif;
    letter-spacing: 2px;
    margin-bottom: 5px;
}

.logo-area p {
    color: #666;
    font-size: 14px;
    margin-bottom: 25px;
}

.input-group {
    margin-bottom: 15px;
}

.input-group input {
    width: 100%;
    padding: 12px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 14px;
}

.btn {
    width: 100%;
    padding: 12px;
    background: #4a6fa5;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-weight: bold;
    transition: background 0.2s;
}

.btn:hover {
    background: #395a86;
}

.error {
    color: #dc3545;
    font-size: 14px;
    margin-bottom: 15px;
}


/* --- DASHBOARD --- */
.app-container {
    display: flex;
    min-height: 100vh;
}

/* Sidebar */
.sidebar {
    width: 250px;
    background: #fff;
    border-right: 1px solid #e0e0e0;
    flex-shrink: 0;
}

.sidebar-header {
    padding: 20px;
    font-size: 14px;
    font-weight: 600;
    color: #666;
    border-bottom: 5px solid #fcfcfc;
}

.sidebar-nav {
    display: flex;
    flex-direction: column;
}

.nav-item {
    padding: 15px 20px;
    text-decoration: none;
    color: #333;
    font-size: 14px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 15px;
    border-left: 3px solid transparent;
}

.nav-item i {
    color: #888;
    width: 20px;
    text-align: center;
}

.nav-item:hover,
.nav-item.active {
    background: #f0f0f0;
}

.nav-item.active {
    background: #e9ecef;
    border-left-color: #4a6fa5;
}

/* Main Content */
.main-content {
    flex-grow: 1;
    padding: 30px;
}

.header-content {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 40px;
}

.logo-icon {
    width: 80px;
    height: 80px;
    object-fit: contain;
    margin-right: 20px;
    mix-blend-mode: multiply;
}

.brand-title {
    font-family: 'Times New Roman', serif;
    font-size: 56px;
    font-weight: normal;
    letter-spacing: 5px;
    text-transform: uppercase;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.1);
}

/* Global Search */
.search-container {
    max-width: 600px;
    margin: 0 auto 40px auto;
    position: relative;
    display: flex;
    align-items: center;
}

.search-icon {
    position: absolute;
    left: 15px;
    color: #6082B6;
    font-size: 18px;
}

#globalSearch {
    width: 100%;
    padding: 15px 15px 15px 45px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 16px;
    outline: none;
    transition: all 0.3s ease;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
}

#globalSearch:focus {
    border-color: #6082B6;
    box-shadow: 0 4px 12px rgba(96, 130, 182, 0.2);
}

body.dark-mode #globalSearch {
    background-color: #1e1e1e;
    border-color: #333;
    color: #fff;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.5);
}

body.dark-mode #globalSearch:focus {
    border-color: #6082B6;
}

/* Dashboard Grid */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 20px;
}

/* Column Styling */
.city-column {
    background: white;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.05);
    display: flex;
    flex-direction: column;
}

.city-header {
    background: #6082B6;
    /* Based on mockup blue-gray */
    color: white;
    text-align: center;
    padding: 12px;
    font-size: 18px;
    font-weight: 600;
    text-transform: uppercase;
}

.open-users-title {
    text-align: center;
    padding: 15px;
    font-size: 22px;
    font-weight: 700;
    color: #000;
}

.column-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 15px;
    border-bottom: 1px solid #eee;
    background: #fafafa;
}

.user-count {
    font-size: 13px;
    color: #666;
    font-weight: 600;
}

.btn-copy {
    background: #f8f9fa;
    border: 1px solid #ddd;
    padding: 5px 10px;
    font-size: 12px;
    border-radius: 4px;
    cursor: pointer;
    color: #444;
}

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

/* List Styling */
.user-list {
    flex-grow: 1;
    overflow-y: auto;
    max-height: 500px;
}

.list-header {
    display: flex;
    justify-content: space-between;
    padding: 8px 15px;
    font-size: 11px;
    color: #888;
    border-bottom: 1px solid #eee;
}

.user-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 15px;
    border-bottom: 1px solid #f5f5f5;
}

.user-row.empty {
    justify-content: center;
    color: #999;
    font-style: italic;
    padding: 20px;
}

.user-name {
    font-size: 13px;
    font-weight: 600;
    color: #333;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 140px;
}

.user-actions {
    display: flex;
    align-items: center;
    gap: 5px;
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: #ccc;
}

.status-dot.online {
    background-color: #4CAF50;
}

.status-dot.offline {
    background-color: #F44336;
}

.btn-view,
.btn-block {
    background: white;
    border: 1px solid #ddd;
    font-size: 9px;
    padding: 3px 6px;
    border-radius: 2px;
    color: #555;
    cursor: pointer;
}

.btn-view:hover {
    background: #f0f0f0;
}

.btn-block:hover {
    background: #fcfcfc;
    color: #dc3545;
    border-color: #dc3545;
}

/* --- NEW UI SECTIONS --- */
.section-card {
    background: white;
    padding: 25px;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    margin-bottom: 30px;
}

.section-card h2 {
    margin-bottom: 20px;
    font-size: 22px;
    color: #333;
    border-bottom: 2px solid #f0f0f0;
    padding-bottom: 10px;
}

.table-responsive {
    overflow-x: auto;
    margin-top: 15px;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    background: white;
}

.data-table th,
.data-table td {
    padding: 12px 15px;
    text-align: left;
    border-bottom: 1px solid #eee;
}

.data-table th {
    background-color: #f8f9fa;
    font-weight: 600;
    color: #555;
}

.data-table tr:hover {
    background-color: #fcfcfc;
}

.city-badge {
    background-color: #6082B6;
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: bold;
}

.city-badge.unassigned {
    background-color: #6c757d;
}

/* --- Stats --- */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    margin-top: 20px;
}

.stat-card {
    background: #fafafa;
    padding: 25px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    text-align: center;
    border-top: 4px solid #6082B6;
}

.stat-card h3 {
    margin-bottom: 15px;
    font-size: 14px;
    color: #666;
    text-transform: uppercase;
}

.stat-value {
    font-size: 36px;
    font-weight: 700;
    color: #2c3e50;
}

.stats-footer {
    margin-top: 20px;
    font-size: 13px;
    color: #888;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* --- Settings --- */
.setting-row {
    background: #fafafa;
    padding: 20px;
    border-radius: 8px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border: 1px solid #eee;
    margin-top: 20px;
}

.setting-info h3 {
    margin-bottom: 5px;
    font-size: 16px;
}

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

/* Switch Toggle */
.switch {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 24px;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: .4s;
}

.slider:before {
    position: absolute;
    content: "";
    height: 16px;
    width: 16px;
    left: 4px;
    bottom: 4px;
    background-color: white;
    transition: .4s;
}

input:checked+.slider {
    background-color: #4a6fa5;
}

input:checked+.slider:before {
    transform: translateX(26px);
}

.slider.round {
    border-radius: 34px;
}

.slider.round:before {
    border-radius: 50%;
}

/* --- Dark Mode Overrides --- */
body.dark-mode {
    background-color: #121212;
    color: #e0e0e0;
}

body.dark-mode .app-container {
    background-color: #121212;
}

body.dark-mode .sidebar {
    background: #1e1e1e;
    border-right-color: #333;
}

body.dark-mode .sidebar-header {
    background: #1e1e1e;
    color: #aaa;
    border-bottom-color: #121212;
}

body.dark-mode .nav-item {
    color: #bbb;
}

body.dark-mode .nav-item:hover {
    background: #2a2a2a;
}

body.dark-mode .nav-item.active {
    background: #2d3748;
    border-left-color: #6082B6;
    color: #fff;
}

body.dark-mode .city-column,
body.dark-mode .section-card {
    background: #1e1e1e;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.5);
}

body.dark-mode .open-users-title {
    color: #fff;
}

body.dark-mode .column-actions {
    background: #252525;
    border-bottom-color: #333;
}

body.dark-mode .user-row {
    border-bottom-color: #2a2a2a;
}

body.dark-mode .btn-copy,
body.dark-mode .btn-view,
body.dark-mode .btn-block {
    background: #2a2a2a;
    border-color: #444;
    color: #ddd;
}

body.dark-mode .btn-copy:hover,
body.dark-mode .btn-view:hover {
    background: #333;
}

body.dark-mode .btn-block:hover {
    background: #1e1e1e;
}

body.dark-mode .user-name {
    color: #ccc;
}

body.dark-mode .modal-content {
    background-color: #1e1e1e;
    border-color: #444;
    color: #fff;
}

body.dark-mode .modal-content h2 {
    color: #eee;
    border-bottom-color: #333;
}

body.dark-mode .user-details p {
    color: #bbb;
}

body.dark-mode .user-details strong {
    color: #eee;
}

body.dark-mode .data-table {
    background-color: #1e1e1e;
}

body.dark-mode .data-table th {
    background-color: #252525;
    color: #aaa;
    border-bottom-color: #444;
}

body.dark-mode .data-table td {
    border-bottom-color: #333;
}

body.dark-mode .data-table tr:hover {
    background-color: #252525;
}

body.dark-mode .stat-card,
body.dark-mode .setting-row {
    background-color: #1e1e1e;
    border-color: #333;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
}

body.dark-mode .stat-value {
    color: #fff;
}

body.dark-mode .stat-card h3 {
    color: #aaa;
}

body.dark-mode .section-card h2 {
    color: #eee;
    border-bottom-color: #333;
}

body.dark-mode .logo-icon {
    filter: invert(1);
    mix-blend-mode: normal;
}

body.dark-mode .brand-title {
    color: #eee;
}

@media (max-width: 1200px) {
    .dashboard-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .dashboard-grid {
        grid-template-columns: 1fr;
    }

    .app-container {
        flex-direction: column;
    }

    .sidebar {
        width: 100%;
        border-right: none;
        border-bottom: 1px solid #e0e0e0;
    }

    .sidebar-nav {
        flex-direction: row;
        overflow-x: auto;
    }

    .brand-title {
        font-size: 36px;
    }
}

/* Modal Styling */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.5);
    justify-content: center;
    align-items: center;
}

.modal-content {
    background-color: #fefefe;
    padding: 30px;
    border: 1px solid #888;
    width: 400px;
    border-radius: 10px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    position: relative;
    font-family: 'Open Sans', sans-serif;
}

.modal-content h2 {
    margin-top: 0;
    margin-bottom: 20px;
    font-size: 20px;
    color: #333;
    border-bottom: 1px solid #eee;
    padding-bottom: 10px;
}

.close-btn {
    color: #aaa;
    float: right;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    position: absolute;
    top: 15px;
    right: 20px;
}

.close-btn:hover,
.close-btn:focus {
    color: #000;
    text-decoration: none;
    cursor: pointer;
}

.user-details p {
    margin: 10px 0;
    font-size: 15px;
    color: #555;
}

.user-details strong {
    color: #222;
    display: inline-block;
    width: 140px;
}

.modal-actions {
    margin-top: 25px;
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}