/* --- CSS GLOBAL & VARIABEL (AESTHETICS FUTURISTIK) --- */
:root {
    --primary-bg: #1a1a2e;
    --secondary-bg: #16213e;
    --card-bg: #0f3460;
    --accent-color: #e94560;
    --glow-color: #8D54FF;
    --text-light: #e0e0e0;
    --text-dark: #cccccc;
    --input-bg: #0a1128;
    --button-hover-bg: #e94560;
    --border-radius: 8px;
    --transition-speed: 0.3s ease-in-out;
    --shadow-dark: 0 8px 30px rgba(0, 0, 0, 0.6);
    --danger-color: #dc3545;
    --success-color: #28a745;
    --info-color: #17a2b8;
    --warning-color: #ffc107;
    --cancel-color: #6c757d;
}

/* Light Mode Variables Override */
body.light-mode {
    --primary-bg: #f4f7fa;
    --secondary-bg: #ffffff;
    --card-bg: #ffffff;
    --accent-color: #e94560;
    --glow-color: #6366f1;
    --text-light: #2d3436;
    --text-dark: #636e72;
    --input-bg: #f1f2f6;
    --button-hover-bg: #d63031;
    --shadow-dark: 0 4px 15px rgba(0, 0, 0, 0.08);
    --danger-color: #eb4d4b;
    --success-color: #2ecc71;
    --info-color: #3498db;
    --warning-color: #f1c40f;
    --cancel-color: #95a5a6;
}

body.light-mode .sticky-header-wrapper {
    background-color: rgba(255, 255, 255, 0.8) !important;
    backdrop-filter: blur(10px);
    border-bottom: 1px solid #ddd;
}

body.light-mode .header-main {
    background-color: transparent !important;
}

body.light-mode .tab-button {
    color: #2d3436;
    background: #e1e4e8;
}

body.light-mode .tab-button.active {
    background: var(--accent-color);
    color: white;
}

body.light-mode .data-table thead th {
    background-color: #f1f2f6;
    color: #2d3436;
}

body.light-mode .data-table tbody tr {
    border-bottom: 1px solid #eee;
}

body.light-mode .data-table tbody tr:hover {
    background-color: #f9f9f9;
}

body.light-mode .inline-notification.info {
    background: rgba(52, 152, 219, 0.1);
    color: #3498db;
}

body.light-mode .menu-options {
    background: #ffffff;
    box-shadow: 0 10px 40px rgba(0,0,0,0.1);
    border: 1px solid #eee;
}

body.light-mode .btn-menu-switch:hover {
    background: #f1f2f6;
}


body {
    font-family: 'Oxanium', sans-serif;
    margin: 0;
    padding: 0;
    background-color: var(--primary-bg);
    color: var(--text-light);
    line-height: 1.6;
    overflow-x: hidden;
}

#login-page {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.login-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 30px;
    background-color: var(--secondary-bg);
    box-shadow: var(--shadow-dark);
    flex-shrink: 0;
}

.login-content {
    flex-grow: 1;
    display: grid;
    grid-template-columns: 1fr;
    gap: 30px;
    padding: 40px 30px;
    max-width: 1200px;
    margin: 0 auto;
    width: 100%;
}

.login-info {
    background-color: var(--card-bg);
    padding: 30px;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-dark);
}

.login-form-card {
    background-color: var(--secondary-bg);
    padding: 33px;
    /* Slightly adjusted padding */
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-dark);
    max-width: 400px;
    width: 100%;
    margin: 0 auto;
}

.login-form-card input {
    width: 100%;
    padding: 12px;
    margin-bottom: 15px;
    border: 1px solid var(--card-bg);
    border-radius: var(--border-radius);
    background-color: var(--input-bg);
    color: var(--text-light);
    box-sizing: border-box;
}

.login-form-card button {
    width: 100%;
    padding: 12px;
}

.btn-theme-toggle {
    background: var(--secondary-bg);
    border: 1px solid var(--card-bg);
    color: var(--text-light);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-speed);
    margin-left: 15px;
    box-shadow: 0 0 10px rgba(0,0,0,0.2);
}

.btn-theme-toggle:hover {
    background: var(--accent-color);
    color: white;
    transform: rotate(30deg);
}

body.light-mode .btn-theme-toggle {
    background: #e1e4e8;
    color: #2d3436;
    border-color: #ccc;
}

.input-group {
    margin-bottom: 20px;
    text-align: left;
}

.input-group label {
    display: block;
    margin-bottom: 8px;
    font-size: 0.9em;
    font-weight: 600;
    color: var(--text-light);
    letter-spacing: 0.5px;
}

.input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.input-wrapper i.toggle-password {
    position: absolute;
    right: 15px;
    cursor: pointer;
    color: var(--text-dark);
    transition: color var(--transition-speed);
    z-index: 10;
}

.input-wrapper i.toggle-password:hover {
    color: var(--accent-color);
}

.input-wrapper input {
    width: 100%;
    padding: 12px 45px 12px 15px;
    margin: 0;
    border: 1px solid var(--card-bg);
    border-radius: var(--border-radius);
    background-color: var(--input-bg);
    color: var(--text-light);
    font-family: inherit;
    transition: border-color var(--transition-speed), box-shadow var(--transition-speed);
}

.input-wrapper input:focus {
    outline: none;
    border-color: var(--accent-color);
    box-shadow: 0 0 10px rgba(233, 69, 96, 0.2);
}

.input-wrapper select {
    width: 100%;
    padding: 12px;
    background: var(--input-bg);
    color: var(--text-light);
    border: 1px solid var(--card-bg);
    border-radius: var(--border-radius);
    font-family: inherit;
    cursor: pointer;
}

.popup-content h3 {
    margin-top: 0;
    font-size: 1.5em;
    letter-spacing: 1px;
    text-transform: uppercase;
}

.hamburger-menu {
    position: relative;
    display: inline-block;
}

.menu-options {
    position: fixed;
    top: 0;
    left: 0;
    height: 100%;
    width: 0;
    background-color: var(--secondary-bg);
    box-shadow: 2px 0 30px rgba(0, 0, 0, 0.8);
    padding: 0;
    z-index: 2000;
    overflow-x: hidden;
    transition: width 0.3s ease-in-out;
    border-right: 3px solid var(--accent-color);
    display: flex;
    flex-direction: column;
}

.menu-options.active {
    width: 250px;
    padding: 20px 0;
}

#pwa-install-btn {
    display: none;
    align-items: center;
    background-color: var(--success-color);
    color: white;
    margin: 10px 15px;
    border-radius: var(--border-radius);
    box-shadow: 0 4px 10px rgba(40, 167, 69, 0.3);
}

.menu-options button,
.menu-options .menu-btn {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 10px 15px;
    background: none;
    border: none;
    color: var(--text-light) !important;
    text-align: left;
    cursor: pointer;
    font-size: 0.85em;
    /* Smaller font */
    transition: all var(--transition-speed);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    font-family: inherit;
    text-decoration: none;
    box-sizing: border-box;
}

.menu-options button:last-child {
    border-bottom: none;
}

.menu-options button i,
.menu-options .menu-btn i {
    width: 16px;
    text-align: center;
    font-size: 1.1em;
    opacity: 0.8;
}

.menu-options button:hover,
.menu-options .menu-btn:hover {
    background-color: var(--card-bg);
    color: var(--accent-color);
    padding-left: 20px;
    /* Slight movement effect */
}

/* Analytics Styles */
.analytics-container {
    width: 100%;
    margin-top: 15px;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.analytics-period-selector {
    display: flex;
    gap: 5px;
    justify-content: center;
    margin-bottom: 10px;
}

.period-btn {
    padding: 5px 12px;
    font-size: 0.8em;
    border-radius: 20px;
    border: 1px solid var(--card-bg);
    background: var(--secondary-bg);
    color: var(--text-dark);
    cursor: pointer;
    transition: all 0.2s;
}

.period-btn.active {
    background: var(--accent-color);
    color: white;
    border-color: var(--accent-color);
    box-shadow: 0 0 10px rgba(233, 69, 96, 0.4);
}

.chart-wrapper {
    position: relative;
    height: 250px;
    width: 100%;
    background: rgba(0, 0, 0, 0.2);
    padding: 15px;
    border-radius: 10px;
}

.stats-summary {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    margin-top: 10px;
}

.stat-card {
    background: var(--card-bg);
    padding: 10px;
    border-radius: 8px;
    text-align: center;
    border-left: 3px solid var(--accent-color);
}

.stat-card .label {
    font-size: 0.7em;
    color: var(--text-dark);
    display: block;
    text-transform: uppercase;
}

.stat-card .value {
    font-size: 1.2em;
    font-weight: bold;
    color: var(--text-light);
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 0 30px 0;
    background-color: var(--primary-bg);
}

.sticky-header-wrapper {
    position: sticky;
    top: 0;
    z-index: 50;
    background-color: var(--secondary-bg);
    border-radius: 0 0 var(--border-radius) var(--border-radius);
    box-shadow: var(--shadow-dark);
    margin-bottom: 20px;
    width: 100%;
    left: 0;
    right: 0;
}

#watermark {
    position: absolute;
    top: 5px;
    left: 30px;
    font-size: 0.8em;
    color: rgba(255, 255, 255, 0.2);
    font-weight: 300;
    z-index: 60;
    letter-spacing: 1px;
}

.header-main {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    margin-bottom: 5px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--accent-color);
    padding: 30px 30px 10px 30px;
}

#event-display-container {
    text-align: center;
    margin-top: 5px;
    margin-bottom: 0px;
    padding: 0;
    width: 100%;
}

.event-banner {
    font-size: 1.5em;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 2px;
    padding: 5px 15px;
    border-radius: 5px;
    display: inline-block;
    transition: opacity 0.5s;
    line-height: 1.5em;
}

.fire-glow-text {
    color: #ffaa00;
}

@keyframes fireGlow {
    0% {
        transform: scale(1.0);
    }

    100% {
        transform: scale(1.02);
    }
}

.header-center {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.header-left {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.header-right {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    justify-content: center;
}

.menu-toggle {
    background: var(--accent-color);
    color: white;
    padding: 10px 15px;
    border: none;
    border-radius: var(--border-radius);
    cursor: pointer;
    font-size: 1.5em;
    line-height: 0.5;
    box-shadow: 0 0 10px rgba(233, 69, 96, 0.5);
    transition: all var(--transition-speed);
}

/* TOOLTIP CSS */
.tooltip-container {
    position: relative;
    display: inline-block;
    cursor: help;
    margin-left: 8px;
    vertical-align: middle;
}

.info-icon {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background-color: var(--info-color);
    color: white;
    font-size: 12px;
    font-weight: bold;
    font-style: normal;
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.tooltip-text {
    visibility: hidden;
    width: 220px;
    background-color: var(--card-bg);
    color: var(--text-light);
    text-align: center;
    border-radius: 6px;
    padding: 10px;
    position: absolute;
    z-index: 100;
    bottom: 135%;
    left: 50%;
    margin-left: -110px;
    opacity: 0;
    transition: opacity 0.3s;
    box-shadow: var(--shadow-dark);
    border: 1px solid var(--glow-color);
    font-size: 0.85em;
    line-height: 1.4;
    pointer-events: none;
    text-transform: none;
    font-weight: normal;
}

.tooltip-text::after {
    content: "";
    position: absolute;
    top: 100%;
    left: 50%;
    margin-left: -5px;
    border-width: 5px;
    border-style: solid;
    border-color: var(--glow-color) transparent transparent transparent;
}

.tooltip-container:hover .tooltip-text {
    visibility: visible;
    opacity: 1;
}

.btn {
    padding: 8px 15px;
    border: none;
    border-radius: var(--border-radius);
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-speed);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-size: 0.9em;
}

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

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

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

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

.btn-menu-switch {
    background-color: var(--secondary-bg);
    color: var(--glow-color);
}

.btn-menu-switch:hover {
    background-color: var(--card-bg);
}

.tab-buttons {
    display: flex;
    align-items: center;
    overflow-x: auto;
    white-space: nowrap;
    gap: 12px;
    margin-bottom: 10px;
    padding: 5px 5px 5px 5px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}

.tab-buttons::-webkit-scrollbar {
    display: none;
}

.tab-button {
    background-color: var(--secondary-bg);
    border: 1px solid var(--card-bg);
    border-radius: 50px;
    padding: 10px 24px;
    color: var(--text-dark);
    font-weight: 500;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    gap: 6px;
}

.tab-button:hover {
    color: var(--text-light);
    background-color: var(--card-bg);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.tab-button.active {
    background: linear-gradient(135deg, var(--accent-color), #ff2e63);
    color: white;
    border-color: transparent;
    font-weight: 700;
    box-shadow: 0 5px 15px rgba(233, 69, 96, 0.5);
    transform: translateY(-2px);
}

.tab-counter {
    font-size: 0.8em;
    background: rgba(0, 0, 0, 0.2);
    padding: 2px 8px;
    border-radius: 12px;
    color: inherit;
    font-weight: normal;
}

.tab-content {
    display: none;
    padding: 20px 30px;
    background-color: var(--primary-bg);
    border-radius: var(--border-radius);
}

.tab-content.active {
    display: block;
}

.tab-grid-area {
    display: grid;
    grid-template-columns: 300px 1fr;
    gap: 30px;
    margin-bottom: 30px;
}

.widget-card-single {
    background-color: var(--card-bg);
    padding: 20px;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-dark);
    border-left: 5px solid var(--glow-color);
    max-width: 300px;
}

.widget-card-single h4 {
    color: var(--glow-color);
    margin-top: 0;
    font-weight: 600;
    font-size: 1em;
}

.widget-card-single p {
    font-size: 4em;
    /* Enlarged font size */
    font-weight: 800;
    color: var(--accent-color);
    margin: 0;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
}

.resi-input-area {
    display: flex;
    gap: 15px;
    align-items: center;
}

.resi-input-area input[type="text"] {
    flex-grow: 1;
    padding: 12px;
    border: 1px solid var(--card-bg);
    border-radius: var(--border-radius);
    background-color: var(--input-bg);
    color: var(--text-light);
    font-size: 1em;
    box-sizing: border-box;
    transition: border-color var(--transition-speed);
}

.resi-input-area input[type="text"]:focus {
    outline: none;
    border-color: var(--accent-color);
    box-shadow: 0 0 5px rgba(233, 69, 96, 0.5);
}

.input-action-container {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.table-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    gap: 15px;
    flex-wrap: wrap;
}

.table-actions input[type="text"] {
    flex-grow: 1;
    max-width: 300px;
    padding: 8px 12px;
    border: 1px solid var(--card-bg);
    border-radius: var(--border-radius);
    background-color: var(--input-bg);
    color: var(--text-light);
    font-size: 0.9em;
}

.table-actions-right {
    flex-shrink: 0;
}

#scanning-cam-layout {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100dvh;
    /* Use dvh for mobile browsers */
    background-color: #000;
    z-index: 9999;
    display: none;
    flex-direction: column;
    overflow: hidden;
    /* Prevent scrolling on full screen cam */
}

.cam-header {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 100;
    background: linear-gradient(to bottom, rgba(0, 0, 0, 0.8), transparent);
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.cam-tab-buttons {
    position: absolute;
    top: 60px;
    /* Below header */
    left: 0;
    width: 100%;
    z-index: 20;
    background: transparent;
    padding: 10px 0;
    display: flex;
    justify-content: center;
    /* Center tabs if few */
    gap: 10px;
    overflow-x: auto;
    white-space: nowrap;
}

/* Ensure tab buttons look good on transparent bg */
.cam-tab-buttons .tab-button {
    background: rgba(0, 0, 0, 0.5);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(4px);
}

.cam-tab-buttons .tab-button.active {
    background: var(--accent-color);
    border-color: var(--accent-color);
}

.cam-overlay-bottom {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    z-index: 150;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.95), transparent);
    padding: 20px 20px 80px 20px;
    /* added bottom padding to clear the flashlight */
    display: flex;
    flex-direction: column;
    gap: 10px;
}

/* Hide the native video element since library creates its own */
#scanner-video {
    display: none;
}

.btn-senter {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 1000;
    width: 60px;
    height: 60px;
    font-size: 1.5em;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.5);
    color: rgba(255, 255, 255, 0.8);
    border: 2px solid rgba(255, 255, 255, 0.3);
    cursor: pointer;
    backdrop-filter: blur(4px);
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 0 15px rgba(0, 0, 0, 0.5);
}

/* Hide scanner frame/box and shaded regions for a clear view */
#scanner-video-container div[style*="position: absolute"] {
    display: none !important;
}

#qr-shaded-region {
    border-width: 0px !important;
    background: transparent !important;
    display: none !important;
}

#scanner-video-container video {
    width: 100vw !important;
    height: 100dvh !important;
    object-fit: contain !important;
    background-color: #000;
}

.btn-senter:hover,
.btn-senter:active {
    background: rgba(233, 69, 96, 0.3);
    color: white;
    transform: translateX(-50%) scale(1.1);
    box-shadow: 0 0 30px rgba(233, 69, 96, 0.4);
}

.btn-senter.active {
    background: var(--warning-color);
    color: #000;
    border-color: #fff;
    box-shadow: 0 0 40px var(--warning-color), 0 0 20px #fff;
    animation: pulse-flash 1.5s infinite alternate;
}

@keyframes pulse-flash {
    from { box-shadow: 0 0 20px var(--warning-color); }
    to { box-shadow: 0 0 50px var(--warning-color), 0 0 30px #fff; }
}

/* Responsiveness for small screens */
@media (max-width: 480px) {
    .cam-header h3 {
        font-size: 0.9em;
    }

    .widget-card-single h4 {
        font-size: 0.9em;
    }

    .widget-card-single p {
        font-size: 3em;
    }
}

.header-center h2 {
    color: var(--glow-color);
    font-weight: 700;
}

#current-datetime-login,
#current-datetime {
    color: var(--glow-color);
    font-size: 0.9em;
    font-weight: 500;
}

.otomatis-info-block {
    padding-top: 15px;
    background-color: var(--secondary-bg);
    padding: 20px;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-dark);
    margin-top: 15px;
}

.otomatis-info-block h4 {
    color: var(--glow-color) !important;
    font-size: 1.1em;
    font-weight: bold;
}

.otomatis-info-block ul {
    list-style: none;
    padding-left: 15px;
}

.otomatis-info-block li {
    margin-bottom: 8px;
    color: var(--text-dark);
    position: relative;
}

.otomatis-info-block li:before {
    content: "•";
    color: var(--accent-color);
    font-size: 1.5em;
    position: absolute;
    left: -15px;
    line-height: 1;
}

.otomatis-info-block li strong {
    color: var(--text-light);
}

.cam-table-ringkas {
    width: 100%;
    border-collapse: collapse;
    margin-top: 15px;
    font-size: 0.8em;
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: var(--shadow-dark);
}

.cam-table-ringkas th,
.cam-table-ringkas td {
    padding: 8px 10px;
    text-align: left;
    border-bottom: 1px solid var(--input-bg);
}

.cam-table-ringkas th {
    background-color: var(--accent-color);
    color: white;
    font-weight: 600;
}

.cam-table-ringkas tbody tr:nth-child(odd) {
    background-color: var(--card-bg);
}

.cam-table-ringkas tbody tr:nth-child(even) {
    background-color: var(--secondary-bg);
}

.cam-table-ringkas tbody tr:hover {
    background-color: rgba(141, 84, 255, 0.1);
}

.inline-notification {
    padding: 10px 15px;
    margin-bottom: 10px;
    border-radius: var(--border-radius);
    font-weight: bold;
    text-align: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s, visibility 0.3s;
    position: relative;
    z-index: 10;
}

#cam-notification {
    padding: 10px 15px;
    border-radius: var(--border-radius);
    font-weight: bold;
    text-align: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s, visibility 0.3s;
    position: absolute;
    top: 125px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 200;
    width: 80%;
    pointer-events: none;
}

.inline-notification.success,
#cam-notification.success {
    background-color: var(--success-color);
    color: white;
    box-shadow: 0 0 10px rgba(40, 167, 69, 0.5);
}

.inline-notification.error,
#cam-notification.error {
    background-color: var(--danger-color);
    color: white;
    box-shadow: 0 0 10px rgba(220, 53, 69, 0.5);
}

.inline-notification.info,
#cam-notification.info {
    background-color: var(--info-color);
    color: white;
    box-shadow: 0 0 10px rgba(23, 162, 184, 0.5);
}

.inline-notification.active,
#cam-notification.active {
    opacity: 1;
    visibility: visible;
}

/* Custom Scrollbar for Tables */
.table-container::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

.table-container::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.2);
    border-radius: var(--border-radius);
}

.table-container::-webkit-scrollbar-thumb {
    background: var(--card-bg);
    border-radius: 4px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.table-container::-webkit-scrollbar-thumb:hover {
    background: var(--accent-color);
}

.table-container {
    overflow-x: auto;
    background-color: var(--secondary-bg);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-dark);
    max-height: 400px !important;
    overflow-y: auto !important;
    display: block !important;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 600px;
}

.data-table th,
.data-table td {
    padding: 12px 15px;
    text-align: left;
    border-bottom: 1px solid var(--card-bg);
}

.data-table th {
    background-color: var(--accent-color);
    color: white;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-size: 0.85em;
}

/* Standardized Search Box with Icon */
.search-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    width: 100%;
}

.search-input-wrapper i {
    position: absolute;
    left: 12px;
    color: var(--accent-color);
    font-size: 0.9em;
    pointer-events: none;
}

.search-input-wrapper input {
    padding: 8px 12px 8px 35px !important;
}

/* Distribution Bar Hover */
.dist-bar-item {
    padding: 10px;
    border-radius: 8px;
    transition: background 0.3s;
}

.dist-bar-item:hover {
    background: rgba(255, 255, 255, 0.05);
}

.data-table thead th {
    position: sticky;
    top: 0;
    z-index: 10;
    background-color: var(--accent-color);
}

.data-table tbody tr:nth-child(even) {
    background-color: var(--input-bg);
}

.data-table tbody tr:nth-child(odd) {
    background-color: var(--secondary-bg);
}

.data-table tbody tr:hover {
    background-color: rgba(141, 84, 255, 0.1);
}

.popup-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(10, 17, 40, 0.9);
    /* Darker overlay */
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 5000;
    backdrop-filter: blur(8px);
    /* Added blur */
}

.popup-content {
    background-color: var(--secondary-bg);
    /* Match dashboard */
    padding: 35px;
    border-radius: 15px;
    /* Uniform rounded corners */
    box-shadow: 0 0 30px rgba(0, 0, 0, 0.8), 0 0 15px rgba(233, 69, 96, 0.2);
    text-align: center;
    max-width: 450px;
    width: 90%;
    border: 2px solid var(--accent-color);
    /* Default accent border */
    animation: popupSlipIn 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    position: relative;
    overflow: hidden;
}

@keyframes popupSlipIn {
    from {
        opacity: 0;
        transform: translateY(-30px) scale(0.95);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.popup-content h3 {
    font-family: 'Oxanium', sans-serif;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    margin-top: 0;
    margin-bottom: 20px;
    font-size: 1.4em;
}

@keyframes scanLine {
    from {
        top: 10%;
    }

    to {
        top: 90%;
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

@media (min-width: 768px) {
    .login-content {
        grid-template-columns: 2fr 1fr;
    }
}

.carousel-container {
    overflow: hidden;
    border-radius: var(--border-radius);
    margin-top: 20px;
    margin-bottom: 20px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.4);
    height: 150px;
}

.carousel-track {
    display: flex;
    transition: transform 0.8s ease-in-out;
    width: 300%;
    height: 100%;
}

.carousel-slide {
    width: 33.333%;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5em;
    font-weight: 700;
    text-align: center;
    padding: 20px;
    box-sizing: border-box;
    background: linear-gradient(135deg, var(--secondary-bg), var(--card-bg));
    color: var(--text-light);
    text-shadow: 1px 1px 5px rgba(0, 0, 0, 0.5);
    border: 2px solid var(--glow-color);
}

.carousel-slide:nth-child(1) {
    border-left: 5px solid var(--accent-color);
    color: var(--accent-color);
}

.carousel-slide:nth-child(2) {
    border-left: 5px solid var(--info-color);
    color: var(--info-color);
}

.carousel-slide:nth-child(3) {
    border-left: 5px solid var(--success-color);
    color: var(--success-color);
}

.store-info-container {
    display: flex;
    gap: 20px;
    justify-content: space-between;
    margin-top: 30px;
}

.store-card {
    flex: 1;
    padding: 15px;
    border-radius: var(--border-radius);
    background-color: var(--secondary-bg);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
}

.store-card h4 {
    color: var(--glow-color);
    margin-top: 0;
    margin-bottom: 5px;
    font-weight: 600;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding-bottom: 5px;
}

.store-section-title {
    color: var(--accent-color);
    font-size: 0.9em;
    font-weight: 700;
    margin-top: 15px;
    margin-bottom: 5px;
    text-transform: uppercase;
}

.store-link {
    display: flex;
    align-items: center;
    padding: 5px 8px;
    margin-bottom: 5px;
    border-radius: 4px;
    color: white;
    text-decoration: none;
    font-size: 0.9em;
    transition: background-color 0.2s;
}

.store-link i {
    margin-right: 10px;
    font-size: 1.1em;
}

.store-link.shopee {
    background-color: # EE4D2D;
}

.store-link.lazada {
    background-color: #1A92C8;
}

.store-link.tokopedia {
    background-color: #42B549;
}

.store-link.instagram {
    background-color: #E1306C;
}

.store-link.tiktok {
    background-color: #000000;
}

.store-link:hover {
    opacity: 0.8;
    transform: scale(1.02);
}

/* --- TABLET RESPONSIVENESS --- */
@media (max-width: 1024px) {
    .tab-grid-area {
        grid-template-columns: 250px 1fr;
        gap: 20px;
    }
    
    .widget-card-single {
        max-width: 100%;
    }

    .container {
        padding: 0 15px 30px 15px;
    }

    .header-main {
        padding: 20px 20px 10px 20px;
    }

    .login-content {
        padding: 30px 20px;
        gap: 20px;
    }
}

/* --- MOBILE RESPONSIVENESS --- */
@media (max-width: 768px) {

    /* Stack Dashboard Grid */
    .tab-grid-area {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    /* Full width widgets */
    .widget-card-single {
        max-width: 100%;
        width: 100%;
        box-sizing: border-box;
        margin-bottom: 20px;
    }

    /* Wrap Input Areas */
    .resi-input-area {
        flex-direction: column;
        align-items: stretch;
    }

    .resi-input-area input[type="text"] {
        width: 100%;
        font-size: 16px;
        /* Prevent zoom on iOS/Android focus */
        margin-bottom: 10px;
    }

    .resi-input-area button {
        width: 100%;
        padding: 12px;
    }

    /* Header Adjustments */
    .header-main {
        grid-template-columns: 1fr;
        text-align: center;
        gap: 15px;
        padding: 15px;
        display: flex;
        flex-direction: column;
    }

    .header-left,
    .header-right,
    .header-center {
        align-items: center;
        justify-content: center;
        width: 100%;
    }

    #watermark {
        position: static;
        text-align: center;
        margin-bottom: 5px;
    }

    /* Store Layout */
    .store-info-container {
        flex-direction: column;
    }

    /* Table Actions */
    .table-actions {
        flex-direction: column;
        align-items: stretch;
    }

    .table-actions input {
        max-width: none;
        margin-bottom: 10px;
    }

    .table-actions-right {
        width: 100%;
    }

    .table-actions-right button {
        width: 100%;
        margin-bottom: 5px;
    }

    /* Login Page */
    .login-header {
        flex-direction: column;
        gap: 15px;
        text-align: center;
        padding: 15px;
    }

    .login-content {
        padding: 20px 15px;
    }

    .btn {
        padding: 12px 20px;
        /* Larger touch target */
    }

    .tab-buttons {
        padding: 0 10px;
        overflow-x: auto;
        flex-wrap: nowrap;
        -webkit-overflow-scrolling: touch;
        justify-content: flex-start;
        gap: 10px;
    }

    .tab-button {
        flex-shrink: 0;
        padding: 10px 20px;
        background-color: var(--card-bg);
        /* Add bg for visibility */
        border-radius: 20px;
        margin-bottom: 5px;
        color: var(--text-light);
    }

    .tab-button.active {
        background-color: var(--accent-color);
        color: white;
        border-bottom: none;
    }
}
/* --- MODERN SWITCH TOGGLE --- */
.switch-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 20px;
    cursor: pointer;
    transition: all var(--transition-speed);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    width: 100%;
    box-sizing: border-box;
    background: none;
    border-left: none;
    border-right: none;
    border-top: none;
}

.switch-container:hover {
    background-color: var(--card-bg);
}

.switch-label {
    display: flex;
    align-items: center;
    gap: 12px;
    color: var(--text-light);
    font-size: 0.85em;
    font-weight: 500;
}

.switch-label i {
    width: 16px;
    text-align: center;
    font-size: 1.1em;
    opacity: 0.8;
    color: var(--glow-color);
}

.switch {
    position: relative;
    display: inline-block;
    width: 46px;
    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: # 555;
    transition: .3s;
    border-radius: 24px;
}

.slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: .3s;
    border-radius: 50%;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

input:checked + .slider {
    background-color: #00AAFF;
}

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

/* Large Switch for Camera View */
.switch-large {
    width: 70px;
    height: 36px;
}

.switch-large .slider {
    border-radius: 36px;
    background-color: #00AAFF; /* Usually ON in cam view */
}

.switch-large .slider:before {
    height: 28px;
    width: 28px;
    left: 4px;
    bottom: 4px;
}

.switch-large input:checked + .slider:before {
    transform: translateX(34px);
}

/* Specific fix for off state of large toggle */
.switch-large input:not(:checked) + .slider {
    background-color: # 555;
}

.switch-large input:not(:checked) + .slider:before {
    transform: translateX(0);
}

.cam-exit-toggle-container {
    position: absolute;
    bottom: 40px;
    right: 30px;
    z-index: 2000;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    background: rgba(0,0,0,0.4);
    padding: 12px;
    border-radius: 20px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255,255,255,0.1);
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
}

.cam-exit-toggle-container span {
    font-size: 0.7em;
    font-weight: 800;
    color: white;
    text-transform: uppercase;
    letter-spacing: 1px;
    text-shadow: 0 2px 4px rgba(0,0,0,0.5);
}

/* TIMELINE TRACKING CSS */
.tracking-row {
    background-color: var(--secondary-bg);
    border-bottom: 2px solid var(--accent-color);
    transition: all var(--transition-speed);
}

.tracking-row > td {
    padding: 10px 20px !important;
}

.timeline-container {
    display: flex;
    align-items: flex-start;
    justify-content: flex-start;
    overflow-x: auto;
    position: relative;
    padding: 15px 0;
    margin: 0;
    white-space: nowrap;
    gap: 0;
}

/* The continuous line */
.timeline-container::before {
    content: '';
    position: absolute;
    top: 25px; /* Center with the dots */
    left: 20px;
    right: 20px;
    height: 2px;
    background-color: var(--card-bg);
    z-index: 1;
}

.timeline-step {
    position: relative;
    z-index: 2;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    width: 130px;
    flex-shrink: 0;
}

.timeline-icon {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background-color: var(--card-bg);
    border: 2px solid var(--text-dark);
    margin-bottom: 8px;
    transition: all 0.3s ease;
}

.timeline-step.completed .timeline-icon {
    background-color: var(--glow-color);
    border-color: var(--glow-color);
    box-shadow: 0 0 10px var(--glow-color);
}

.timeline-step.active .timeline-icon {
    background-color: var(--accent-color);
    border-color: var(--accent-color);
    box-shadow: 0 0 15px var(--accent-color);
    animation: pulse 1.5s infinite;
}

.timeline-content {
    font-size: 0.75em;
    font-weight: 600;
    color: var(--text-light);
    white-space: normal;
    word-wrap: break-word;
    padding: 0 5px;
    line-height: 1.2;
}

.timeline-date {
    font-size: 0.65em;
    color: var(--text-dark);
    margin-top: 4px;
}

.tracking-toggle-btn {
    transition: transform 0.3s ease;
}

.tracking-toggle-btn.open {
    transform: rotate(180deg);
    color: var(--accent-color);
}

/* NOTEPAD POPUP STYLES */
.notepad-popup {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 320px;
    background-color: var(--secondary-bg);
    border: 2px solid var(--accent-color);
    border-radius: var(--border-radius);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.8);
    z-index: 1000;
    font-family: 'Oxanium', sans-serif;
    color: var(--text-light);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transition: opacity 0.3s ease;
}

.notepad-header {
    background-color: var(--card-bg);
    padding: 12px 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: move;
    border-bottom: 2px solid var(--accent-color);
}

.notepad-header #notepad-title {
    font-weight: 700;
    font-size: 0.9em;
    color: var(--glow-color);
    text-transform: uppercase;
    letter-spacing: 1px;
    user-select: none;
}

.notepad-actions button {
    background: none;
    border: none;
    color: var(--text-dark);
    cursor: pointer;
    font-size: 1.1em;
    transition: color 0.3s;
    margin-left: 10px;
}

.notepad-actions button:hover {
    color: var(--accent-color);
}

.notepad-body {
    padding: 15px;
    background-image: repeating-linear-gradient(transparent, transparent 39px, rgba(255,255,255,0.05) 39px, rgba(255,255,255,0.05) 40px);
    background-attachment: local;
    min-height: 250px;
}

.notepad-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    margin-bottom: 0px;
    height: 40px;
    padding-bottom: 5px;
}

.notepad-row label {
    font-weight: 600;
    color: var(--text-light);
    font-size: 0.95em;
    width: 35%;
    margin-bottom: 0px;
}

.notepad-input, .notepad-text {
    width: 60%;
    background: transparent;
    border: none;
    border-bottom: 1px dashed rgba(255,255,255,0.2);
    color: var(--accent-color);
    font-family: 'Oxanium', sans-serif;
    font-size: 1.1em;
    font-weight: 700;
    text-align: right;
    outline: none;
    padding: 0 5px;
}

.notepad-input:focus {
    border-bottom: 1px solid var(--accent-color);
    box-shadow: none;
}

.notepad-text {
    border-bottom: none;
}

.notepad-input::placeholder {
    color: rgba(255, 255, 255, 0.15);
    font-weight: normal;
}

.notepad-footer {
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: var(--card-bg);
    border-top: 1px solid rgba(255,255,255,0.05);
}

.notepad-footer button {
    font-size: 0.85em;
    padding: 8px 15px;
    border-radius: 4px;
}

.notepad-popup.view-mode .notepad-input {
    display: none;
}
.notepad-popup.view-mode .notepad-text {
    display: block;
}
.notepad-popup:not(.view-mode) .notepad-input {
    display: block;
}
.notepad-popup:not(.view-mode) .notepad-text {
    display: none;
}
.notepad-popup.view-mode .notepad-footer button {
    display: none !important;
}
.notepad-popup.view-mode .notepad-footer {
    display: flex !important;
    justify-content: center !important; 
}

/* CLI Activity Log Styles */
.cli-log-admin {
    color: #ff4444;
    font-weight: bold;
}

.cli-log-staff {
    color: #4444ff;
    font-weight: bold;
}

.cli-log-msg {
    color: #ffffff;
}

.blinking-cursor {
    animation: blink 1s step-end infinite;
}

@keyframes blink {
    50% { opacity: 0; }
}

/* Permissions Popup Styling */
.permissions-list {
    margin-top: 10px;
}

.perm-item {
    transition: background 0.2s;
}

.perm-item:hover {
    background: rgba(255, 255, 255, 0.02);
}

.perm-info {
    flex-grow: 1;
}

#permissions-popup .popup-content {
    background: linear-gradient(135deg, #1e1e2f 0%, #161625 100%);
    box-shadow: 0 10px 40px rgba(0,0,0,0.8), 0 0 15px rgba(0, 170, 255, 0.1);
}

#permissions-popup .btn-primary:active {
    transform: scale(0.95);
}

/* --- RUNNING TEXT --- */
.running-text-wrapper {
    width: 100%;
    overflow: hidden;
    background: #0f0f1a; /* Dark sleek background */
    border-top: 1px solid #e94560;
    border-bottom: 1px solid #e94560;
    padding: 0;
    height: 35px !important;
    min-height: 35px !important;
    max-height: 35px !important;
    line-height: 35px;
    position: relative;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.5);
    z-index: 10;
    white-space: nowrap !important;
}

.marquee-track {
    display: inline-block !important;
    white-space: nowrap !important;
    width: max-content !important;
    animation: marquee-smooth 25s linear infinite;
    will-change: transform;
}

.marquee-track:hover {
    animation-play-state: paused;
}

.running-text-content {
    display: inline-block !important;
    white-space: nowrap !important;
    color: var(--accent-color); /* Match with count resi color */
    font-family: 'Oxanium', sans-serif;
    font-weight: 700;
    font-size: 1rem;
    letter-spacing: 1.5px;
    padding-right: 120px;
    line-height: 35px;
    text-transform: uppercase;
    vertical-align: top;
}

@keyframes marquee-smooth {
    0% { transform: translateX(0); }
    100% { transform: translateX(-50%); }
}
