:root {
    --bg-deep: #050505;
    --bg-surface: #0f0f0f;
    --bg-card: rgba(20, 20, 20, 0.6); 
    --border-subtle: rgba(255, 255, 255, 0.08);
    --text-main: #ffffff;
    --text-muted: #888888;
    --accent-color: #ffffff;
    --accent-secondary: #3b82f6;
    --success-green: #10b981;
    --danger-red: #ef4444;
    --glass-backdrop: blur(20px);
    --transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: 'Outfit', sans-serif;
    background-color: var(--bg-deep);
    color: var(--text-main);
    line-height: 1.6;
    min-height: 100vh;
    overflow-x: hidden;
    background-image: radial-gradient(circle at 15% 50%, rgba(59, 130, 246, 0.08), transparent 25%), 
                      radial-gradient(circle at 85% 30%, rgba(255, 255, 255, 0.03), transparent 25%);
}

/* --- Starry Night Background Styles --- */
#star-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    pointer-events: none;
    overflow: hidden;
    transition: filter 0.4s ease;
}

.star {
    position: absolute;
    background: white;
    border-radius: 50%;
    opacity: 0.8;
    animation: twinkle 2s infinite ease-in-out;
}

@keyframes twinkle {
    0%, 100% { opacity: 0.8; }
    50% { opacity: 0.3; }
}

button {
    font-family: 'Outfit', sans-serif;
    cursor: pointer;
    border: none;
    outline: none;
}

.app-container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 40px 20px;
    display: none;
    animation: fadeIn 0.8s ease-out;
    transition: filter 0.4s ease;
}

/* BLUR UTILITY FOR TRAY */
.content-blur {
    filter: blur(5px) brightness(0.5);
    pointer-events: none;
    user-select: none;
}

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

/* ========================================= */
/* ADMIN PANEL & MANAGED USER STYLES */
/* ========================================= */

.managed-users-grid {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.user-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-subtle);
    padding: 15px;
    border-radius: 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    transition: var(--transition);
}

.user-card:hover {
    background: rgba(255, 255, 255, 0.06);
    border-color: var(--accent-secondary);
}

.user-card.active-selection {
    background: rgba(59, 130, 246, 0.15);
    border-color: var(--accent-secondary);
    box-shadow: 0 0 15px rgba(59, 130, 246, 0.1);
    transform: translateX(5px);
}

.user-card-info {
    display: flex;
    flex-direction: column;
    overflow: hidden; /* Ensures long emails don't break layout */
    margin-right: 15px; /* Spacing from status indicator */
}

.user-card-email {
    color: white;
    font-weight: 500;
    font-size: 0.95rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.user-card-role {
    color: var(--text-muted);
    font-size: 0.8rem;
    margin-top: 2px;
}

.user-status-indicator {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    padding: 6px 12px; /* Slightly increased padding */
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.05);
    color: #666;
    border: 1px solid transparent;
    flex-shrink: 0;      /* Prevents squishing */
    white-space: nowrap; /* Prevents text wrapping */
}

.user-status-indicator.online {
    background: rgba(16, 185, 129, 0.15);
    color: var(--success-green);
    border: 1px solid rgba(16, 185, 129, 0.2);
}

.status-dot-pulse {
    width: 8px;
    height: 8px;
    background-color: currentColor;
    border-radius: 50%;
    animation: pulseDot 1.5s infinite;
    flex-shrink: 0; /* Prevents dot from becoming an oval */
    display: inline-block;
}

@keyframes pulseDot {
    0% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.5; transform: scale(0.8); }
    100% { opacity: 1; transform: scale(1); }
}

/* ========================================= */
/* SEARCH & FILTER BAR STYLES */
/* ========================================= */
.search-filter-container {
    display: flex;
    gap: 15px;
    margin-bottom: 20px;
    position: relative;
}

.search-box-wrapper {
    flex: 1;
    position: relative;
}

.search-icon {
    position: absolute;
    left: 8px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    pointer-events: none;
}

.search-input {
    width: 100%;
    padding: 12px 12px 12px 30px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-subtle);
    border-radius: 12px;
    color: white;
    font-family: 'Outfit', sans-serif;
    font-size: 0.95rem;
    transition: var(--transition);
}

.search-input:focus {
    outline: none;
    border-color: var(--accent-secondary);
    background: rgba(255, 255, 255, 0.08);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.filter-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 0 10px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-subtle);
    border-radius: 12px;
    color: white;
    font-weight: 500;
    transition: var(--transition);
    white-space: nowrap;
    height: 46px;
}

.filter-btn:hover, .filter-btn.active {
    background: white;
    color: black;
}

/* Dropdown Menu */
.filter-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 10px;
    background: rgba(20, 20, 20, 0.95);
    backdrop-filter: blur(20px);
    border: 1px solid var(--border-subtle);
    border-radius: 16px;
    padding: 10px;
    min-width: 220px;
    max-height: 45vh;
    overflow-y: scroll;
    box-shadow: 0 20px 50px rgba(0,0,0,0.5);
    z-index: 100;
    display: none;
    animation: dropIn 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.filter-dropdown.show {
    display: block;
}

@keyframes dropIn {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

.dropdown-header {
    font-size: 0.75rem;
    text-transform: uppercase;
    color: var(--text-muted);
    letter-spacing: 1px;
    padding: 8px 12px 4px;
    font-weight: 600;
}

.dropdown-item {
    padding: 10px 12px;
    border-radius: 8px;
    color: white;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 0.9rem;
}

.dropdown-item:hover {
    background: rgba(255,255,255,0.1);
}

.dropdown-item.selected {
    background: rgba(59, 130, 246, 0.15);
    color: var(--accent-secondary);
}

.dropdown-item.selected::after {
    content: '✓';
    font-weight: bold;
}

.dropdown-divider {
    height: 1px;
    background: var(--border-subtle);
    margin: 8px 0;
}

/* --- Toast Notification System --- */
#toast-container {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 3000;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.toast {
    background: rgba(20, 20, 20, 0.95);
    backdrop-filter: blur(10px);
    border: 1px solid var(--border-subtle);
    border-left: 4px solid var(--accent-secondary);
    color: white;
    padding: 16px 20px;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
    min-width: 300px;
    max-width: 400px;
    animation: slideIn 0.4s ease-out forwards;
    display: flex;
    flex-direction: column;
}

.toast-title {
    font-weight: 600;
    font-size: 1rem;
    margin-bottom: 4px;
    color: white;
}

.toast-msg {
    font-size: 0.9rem;
    color: #ccc;
}

.toast-note {
    font-size: 0.75rem;
    color: #666;
    margin-top: 8px;
    font-style: italic;
}

.toast.hiding {
    animation: slideOut 0.4s ease-in forwards;
}

@keyframes slideIn {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

@keyframes slideOut {
    from { transform: translateX(0); opacity: 1; }
    to { transform: translateX(100%); opacity: 0; }
}

/* --- Loading Screen --- */
#loading-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--bg-deep);
    z-index: 5000;
    display: flex;
    justify-content: center;
    align-items: center;
    flex-direction: column;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 3px solid rgba(255,255,255,0.1);
    border-radius: 50%;
    border-top-color: var(--accent-secondary);
    animation: spin 1s ease-in-out infinite;
    margin-bottom: 20px;
}

.loading-text {
    color: var(--text-muted);
    font-size: 0.9rem;
    letter-spacing: 2px;
    text-transform: uppercase;
    animation: pulse 2s infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

@keyframes pulse {
    0%, 100% { opacity: 0.5; }
    50% { opacity: 1; }
}

/* --- Login Overlay --- */
#login-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--bg-deep);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 2000;
    padding: 20px;
}

.login-box {
    background: rgba(20, 20, 20, 0.8);
    backdrop-filter: var(--glass-backdrop);
    padding: 4rem 3rem;
    border-radius: 24px;
    border: 1px solid var(--border-subtle);
    text-align: center;
    max-width: 420px;
    width: 100%;
    box-shadow: 0 20px 50px rgba(0,0,0,0.5);
}

.login-box h2 {
    font-weight: 300;
    letter-spacing: -0.5px;
    font-size: 2rem;
    margin-bottom: 1rem;
    background: linear-gradient(to right, #fff, #888);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.login-box p {
    color: var(--text-muted);
    margin-bottom: 2.5rem;
    font-weight: 300;
}

.premium-input {
    width: 100%;
    padding: 16px 20px;
    margin-bottom: 1rem;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-subtle);
    border-radius: 12px;
    color: white;
    font-size: 1rem;
    font-family: 'Outfit', sans-serif;
    transition: var(--transition);
}

.premium-input:focus {
    border-color: var(--accent-secondary);
    background: rgba(255, 255, 255, 0.05);
    outline: none;
    box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.1);
}

/* Password Toggle Styles */
.password-wrapper {
    position: relative;
    width: 100%;
    margin-bottom: 1rem;
}

.password-wrapper input {
    margin-bottom: 0;
    padding-right: 45px;
}

.password-toggle-icon {
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    cursor: pointer;
    color: var(--text-muted);
    font-size: 1.1rem;
    transition: color 0.3s;
    z-index: 10;
}

.password-toggle-icon:hover {
    color: white;
}

select.premium-input option {
    background-color: #1a1a1a;
    color: white;
    padding: 10px;
}

.premium-btn {
    width: 100%;
    padding: 16px;
    border-radius: 12px;
    background: white;
    color: black;
    font-weight: 600;
    font-size: 1rem;
    transition: var(--transition);
    margin-top: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.premium-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(255, 255, 255, 0.1);
}

.premium-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* DANGER MODE (For Lock Button) */
.premium-btn.danger-mode {
    background: rgba(239, 68, 68, 0.15);
    color: var(--danger-red);
    border: 1px solid rgba(239, 68, 68, 0.3);
}

.premium-btn.danger-mode:hover {
    background: var(--danger-red);
    color: white;
    box-shadow: 0 5px 15px rgba(239, 68, 68, 0.3);
}

/* SUCCESS MODE (For Unlock Button) */
.premium-btn.success-mode {
    background: rgba(16, 185, 129, 0.15);
    color: var(--success-green);
    border: 1px solid rgba(16, 185, 129, 0.3);
}

.premium-btn.success-mode:hover {
    background: var(--success-green);
    color: white;
    box-shadow: 0 5px 15px rgba(16, 185, 129, 0.3);
}

/* --- Header & Nav --- */
header {
    text-align: center;
    margin-bottom: 4rem;
}

header h1 {
    font-weight: 200;
    letter-spacing: -2px;
    font-size: 3.5rem;
    margin-bottom: 1rem;
    background: linear-gradient(180deg, #fff 0%, #aaa 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.user-info-bar {
    display: inline-flex;
    align-items: center;
    gap: 20px;
    background: rgba(255,255,255,0.03);
    padding: 8px 16px;
    border-radius: 50px;
    border: 1px solid var(--border-subtle);
    margin-bottom: 30px;
    font-size: 0.9rem;
}

.logout-btn {
    background: transparent;
    color: var(--text-muted);
    font-size: 0.8rem;
    border-left: 1px solid var(--border-subtle);
    padding-left: 15px;
}

.logout-btn:hover {
    color: white;
}

.sync-dot {
    width: 8px;
    height: 8px;
    background-color: #10b981;
    border-radius: 50%;
    display: inline-block;
    box-shadow: 0 0 10px #10b981;
    transition: background-color 0.3s, box-shadow 0.3s;
}

.sync-dot.offline {
    background-color: #ef4444;
    box-shadow: 0 0 10px #ef4444;
}

nav {
    display: inline-flex;
    background: rgba(20, 20, 20, 0.8);
    padding: 6px;
    border-radius: 16px;
    border: 1px solid var(--border-subtle);
    backdrop-filter: blur(10px);
    gap: 5px;
    flex-wrap: wrap;
    justify-content: center;
}

.nav-btn {
    padding: 10px 20px;
    background: transparent;
    color: var(--text-muted);
    border-radius: 12px;
    transition: var(--transition);
    font-weight: 500;
    position: relative;
}

.nav-btn:hover {
    color: white;
    background: rgba(255,255,255,0.05);
}

.nav-btn.active {
    background: var(--accent-color);
    color: black;
    font-weight: 600;
    box-shadow: 0 5px 15px rgba(0,0,0,0.3);
}

.nav-btn.locked {
    opacity: 0.7;
    cursor: not-allowed;
    background: rgba(255,255,255,0.02);
}

.nav-btn.locked::after {
    content: '\f023';
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    margin-left: 8px;
    font-size: 0.8rem;
    color: #ef4444;
}

.tab-content {
    display: none;
    opacity: 0;
    transform: translateY(10px);
    transition: opacity 0.5s ease, transform 0.5s ease;
}

.tab-content.active {
    display: block;
    opacity: 1;
    transform: translateY(0);
}

.form-and-ticket {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
    align-items: start;
}

.glass-panel {
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: 24px;
    padding: 2.5rem;
    backdrop-filter: var(--glass-backdrop);
}

.glass-panel h2 {
    font-weight: 400;
    margin-bottom: 2rem;
    font-size: 1.5rem;
    border-bottom: 1px solid var(--border-subtle);
    padding-bottom: 15px;
}

/* ============================ */
/* TICKET DESIGN WITH CUTOUTS */
/* ============================ */

#ticketTemplate, #modalTicketTemplate {
    background: transparent;
    width: 100%;
    color: white;
    position: relative;
    border: none;
    box-shadow: none;
    filter: drop-shadow(0 20px 40px rgba(0,0,0,0.6));
    display: flex;
    flex-direction: column;
}

.ticket-content-wrapper {
    background: 
        radial-gradient(circle at bottom left, transparent 15px, #000 16px) bottom left,
        radial-gradient(circle at bottom right, transparent 15px, #000 16px) bottom right;
    background-size: 51% 100%;
    background-repeat: no-repeat;
    
    padding: 30px;
    position: relative;
    z-index: 2;
    border-radius: 20px 20px 0 0;
    
    border: 1px solid #333;
    border-bottom: none;
    
    border-top: 4px solid #3b82f6; 
}

.ticket-footer {
    background: 
        radial-gradient(circle at top left, transparent 15px, #080808 16px) top left,
        radial-gradient(circle at top right, transparent 15px, #080808 16px) top right;
    background-size: 51% 100%;
    background-repeat: no-repeat;
    
    padding: 15px 30px;
    text-align: center;
    font-size: 0.75rem;
    color: #555;
    position: relative;
    border-radius: 0 0 20px 20px;
    
    border: 1px solid #333;
    border-top: none;
}

.ticket-footer::after {
    content: '';
    position: absolute;
    top: 0;
    left: 20px;
    right: 20px;
    height: 1px;
    border-top: 1px dashed #333;
}

.ticket-header {
    text-align: center;
    margin-bottom: 2rem;
}

.ticket-header h3 {
    font-weight: 700;
    letter-spacing: 3px;
    font-size: 1.4rem;
    margin-bottom: 5px;
    text-transform: uppercase;
}

.ticket-header p {
    color: var(--text-muted);
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.ticket-body {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.ticket-info-row {
    margin-bottom: 15px;
}

.ticket-label {
    font-size: 0.7rem;
    text-transform: uppercase;
    color: #666;
    letter-spacing: 1px;
    display: block;
    margin-bottom: 2px;
}

.ticket-value {
    font-size: 1.1rem;
    font-weight: 500;
    color: white;
}

.ticket-qr {
    background: white;
    padding: 10px;
    border-radius: 10px;
}

.serial-pill {
    display: inline-block;
    background: #111;
    padding: 4px 12px;
    border-radius: 20px;
    font-family: monospace;
    border: 1px solid #333;
    margin-top: 10px;
    font-size: 0.8rem;
    color: #888;
}

/* --- Tables --- */
.table-container {
    overflow-x: auto;
    border-radius: 20px;
    border: 1px solid var(--border-subtle);
}

table {
    width: 100%;
    border-collapse: collapse;
    background: var(--bg-card);
}

th {
    background: rgba(255,255,255,0.05);
    padding: 18px;
    text-align: left;
    font-weight: 500;
    font-size: 0.9rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
    white-space: nowrap;
}

td {
    padding: 8px;
    border-bottom: 1px solid var(--border-subtle);
    font-weight: 300;
    vertical-align: middle;
}

/* SPECIFIC AUTO-WIDTH LOGIC FOR GUEST NAME
   Targeting the 3rd column (index 2) because col 1 is checkbox, col 2 is serial
*/
.tickets-table th.guest-name-col, 
.tickets-table td:nth-child(3) {
    white-space: nowrap; /* Forces the text to stay on one line */
    width: 1%; /* Trick: Makes the column shrink to fit content, but since content is nowrap, it expands to fit largest item */
}

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

tr:hover td {
    background: rgba(255,255,255,0.02);
}

.status-badge {
    padding: 6px 14px;
    border-radius: 30px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    white-space: nowrap;
    display: inline-block;
}

.status-coming-soon {
    background: rgba(245, 158, 11, 0.1);
    color: #f59e0b;
    border: 1px solid rgba(245, 158, 11, 0.2);
}

.status-arrived {
    background: rgba(16, 185, 129, 0.1);
    color: #10b981;
    border: 1px solid rgba(16, 185, 129, 0.2);
}

.status-absent {
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
    border: 1px solid rgba(239, 68, 68, 0.2);
}

.action-btn-small {
    padding: 6px 14px;
    border-radius: 8px;
    background: rgba(255,255,255,0.1);
    color: white;
    font-size: 0.8rem;
    transition: var(--transition);
    white-space: nowrap;
}

.action-btn-small:hover {
    background: white;
    color: black;
}

.export-btn-small {
    padding: 6px 12px;
    border-radius: 8px;
    background: rgba(16, 185, 129, 0.15);
    color: var(--success-green);
    font-size: 0.85rem;
    font-weight: 500;
    transition: var(--transition);
    white-space: nowrap;
    border: 1px solid rgba(16, 185, 129, 0.3);
    display: flex;
    align-items: center;
    gap: 8px;
}

.export-btn-small:hover {
    background: var(--success-green);
    color: black;
}

.export-btn-small:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    filter: grayscale(1);
    background: rgba(255,255,255,0.05);
    color: #666;
    border-color: #333;
}

#refreshStatusIndicator {
    cursor: pointer; 
    color: var(--text-muted); 
    font-size: 1rem; 
    transition: all 0.3s;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: rgba(255,255,255,0.05);
}

#refreshStatusIndicator:hover {
    background: rgba(255,255,255,0.15);
    color: white;
    transform: scale(1.1);
}

#scanner-container {
    position: relative;
    width: 100%;
    max-width: 480px;
    margin: 0 auto 2rem auto;
    border-radius: 24px;
    overflow: hidden;
    border: 1px solid var(--border-subtle);
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
}

#scanner-video {
    width: 100%;
    height: auto;
    display: block;
    opacity: 0.8;
}

.scanner-overlay {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 250px;
    height: 250px;
    border: 2px solid rgba(255,255,255,0.3);
    border-radius: 20px;
    box-shadow: 0 0 0 4000px rgba(0,0,0,0.8);
}

.scanner-overlay::after {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    border-radius: 20px;
    background: linear-gradient(45deg, transparent 40%, rgba(255,255,255,0.8) 50%, transparent 60%);
    background-size: 200% 200%;
    animation: scanGlow 3s infinite linear;
    z-index: 2;
    opacity: 0.5;
}

/* --- Modals --- */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(5px);
    z-index: 4000;
    display: none;
    justify-content: center;
    align-items: center;
}

.modal-box {
    background: #1a1a1a;
    border: 1px solid var(--border-subtle);
    padding: 30px;
    border-radius: 20px;
    text-align: center;
    max-width: 400px;
    width: 90%;
    box-shadow: 0 20px 60px rgba(0,0,0,0.8);
    animation: popIn 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes popIn {
    from { transform: scale(0.9); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

.modal-box h3 {
    font-size: 1.5rem;
    margin-bottom: 10px;
    color: white;
    font-weight: 500;
}

.modal-box p {
    color: #aaa;
    margin-bottom: 25px;
    line-height: 1.5;
}

.modal-actions {
    display: flex;
    gap: 15px;
    justify-content: center;
}

.modal-btn {
    padding: 12px 24px;
    border-radius: 12px;
    font-weight: 600;
    font-size: 0.95rem;
    flex: 1;
}

.modal-btn.secondary {
    background: rgba(255,255,255,0.1);
    color: white;
}

.modal-btn.secondary:hover {
    background: rgba(255,255,255,0.2);
}

.modal-btn.danger {
    background: #ef4444;
    color: white;
}

.modal-btn.danger:hover {
    background: #dc2626;
    box-shadow: 0 5px 15px rgba(239, 68, 68, 0.3);
}

.modal-btn.success {
    background: var(--success-green);
    color: black;
}

.modal-btn.success:hover {
    background: #059669;
    box-shadow: 0 5px 15px rgba(16, 185, 129, 0.3);
}

.checkbox-label {
    display: flex;
    align-items: center;
    padding: 12px;
    background: rgba(255,255,255,0.03);
    border-radius: 8px;
    cursor: pointer;
    transition: var(--transition);
    color: #ccc;
    font-size: 0.95rem;
    border: 1px solid transparent; /* Prepare for border change */
}

.checkbox-label:hover {
    background: rgba(255,255,255,0.06);
    color: white;
}

/* MARK LOCKED TABS IN RED: Highlighting checked boxes in the admin panel */
.checkbox-label:has(input:checked) {
    background: rgba(239, 68, 68, 0.1);
    border-color: rgba(239, 68, 68, 0.4);
    color: var(--danger-red);
}

.lock-checkbox, .remote-lock-checkbox {
    margin-right: 12px;
    transform: scale(1.3);
    accent-color: var(--danger-red); /* Red checkbox checkmark */
}

.close-modal-btn {
    position: absolute;
    top: 15px;
    right: 15px;
    background: rgba(255,255,255,0.1);
    border: none;
    color: #aaa;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
    z-index: 10;
}

.close-modal-btn:hover {
    background: rgba(239, 68, 68, 0.2);
    color: #ef4444;
}

/* ========================================= */
/* SIDE CONTACT TRAY STYLES */
/* ========================================= */
.contact-tray {
    position: fixed;
    right: 0;
    top: 75%; 
    bottom: auto; 
    transform: translateY(-50%) translateX(100%);
    width: 300px;
    height: auto; 
    max-height: 45vh; 
    background: rgba(0, 0, 0, 0.9);
    border: 3px solid rgba(255, 255, 255, 0.2);
    border-right: none;
    border-radius: 20px 0 0 20px;
    backdrop-filter: blur(20px);
    z-index: 4500;
    transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    box-shadow: -10px 0 30px rgba(0,0,0,0.5);
    display: flex;
    flex-direction: column;
}

.contact-tray.open {
    transform: translateY(-50%) translateX(0);
}

.tray-handle {
    position: absolute;
    left: -40px;
    top: 50%;
    transform: translateY(-50%);
    width: 40px;
    height: 80px;
    background: var(--bg-surface);
    border: 3px solid rgba(255, 255, 255, 0.2);
    border-right: none;
    border-radius: 12px 0 0 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: white;
    box-shadow: -5px 0 15px rgba(0,0,0,0.3);
}

.tray-handle:hover {
    background: #222;
}

.tray-content {
    padding: 25px;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: #333 transparent;
}

.tray-heading {
    color: white;
    margin-bottom: 20px;
    text-align: center;
    font-size: 1.5rem;
    border-bottom: 1px solid var(--border-subtle);
    padding-bottom: 15px;
}

.contact-section {
    margin-bottom: 25px;
    border-bottom: 1px solid rgba(255,255,255,0.05);
    padding-bottom: 15px;
}

.contact-section:last-child {
    border-bottom: none;
    padding-bottom: 0;
    margin-bottom: 0;
}

.section-header-wrapper {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 10px;
}

.contact-section h3 {
    font-size: 0.9rem;
    text-transform: uppercase;
    color: #666;
    margin-bottom: 0;
    letter-spacing: 1px;
}

.contact-card {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.contact-name {
    font-weight: 500;
    font-size: 1rem;
    color: white;
}

.contact-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.call-btn-small {
    background: white;
    color: black;
    text-decoration: none;
    font-size: 0.8rem;
    font-weight: 600;
    padding: 6px 12px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    gap: 5px;
    transition: var(--transition);
}

.call-btn-small:hover {
    background: #ccc;
    transform: scale(1.05);
}

.whatsapp-btn-small {
    background: #25D366;
    color: white;
    text-decoration: none;
    font-size: 0.9rem; 
    padding: 6px 10px; 
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}

.whatsapp-btn-small:hover {
    background: #128C7E;
    transform: scale(1.05);
}

@media (max-width: 768px) {
    .form-and-ticket { grid-template-columns: 1fr; }
    header h1 { font-size: 2.2rem; }
    .login-box { padding: 2rem; }
    .nav-btn { flex: 1; text-align: center; font-size: 0.9rem; }
    #toast-container { right: 20px; left: 20px; bottom: 20px; }
    .search-filter-container { flex-direction: row; gap: 5px; }
    
    .contact-tray {
        width: 85%;
    }
}

/* TOOLTIP STYLES */
.info-icon-wrapper {
    position: relative;
    cursor: help;
    color: #555;
    transition: color 0.3s;
    display: flex;
    align-items: center;
}

.info-icon-wrapper:hover {
    color: var(--accent-secondary);
}

.info-tooltip {
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: #222;
    color: #eee;
    padding: 8px 12px;
    border-radius: 8px;
    font-size: 0.75rem;
    font-weight: 400;
    text-transform: none;
    width: 200px;
    text-align: center;
    visibility: hidden;
    opacity: 0;
    transition: opacity 0.3s, visibility 0.3s;
    pointer-events: none;
    border: 1px solid var(--border-subtle);
    box-shadow: 0 5px 15px rgba(0,0,0,0.5);
    z-index: 5000;
    margin-bottom: 8px;
}

.info-tooltip::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    margin-left: -5px;
    border-width: 5px;
    border-style: solid;
    border-color: #222 transparent transparent transparent;
}

.info-icon-wrapper:hover .info-tooltip {
    visibility: visible;
    opacity: 1;
}

.info-tooltip.bottom {
    bottom: auto;
    top: 100%;
    margin-bottom: 0;
    margin-top: 8px;
}

.info-tooltip.bottom::after {
    top: auto;
    bottom: 100%;
    border-color: transparent transparent #222 transparent;
}
