:root {
    --bg-dark: #020617;
    --bg-panel: #0f172a;
    --primary: #00f2ff;
    --primary-hover: #00d2dd;
    --text-main: #e2e8f0;
    --text-muted: #94a3b8;
    --border-color: #1e293b;
    --success: #22c55e;
    --danger: #ef4444;
    --warning: #f59e0b;
    --purple: #b900ff;
    --glass-blur: blur(8px);
    --glass-border: 1px solid var(--border-color);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Outfit', 'Segoe UI', sans-serif;
}

body {
    background-color: var(--bg-dark);
    color: var(--text-main);
}

.app-container {
    display: flex;
    height: 100vh;
    width: 100vw;
}

/* Ensure natural scrolling on mobile */
@media (max-width: 992px) {
    body {
        overflow-y: auto !important;
        overflow-x: hidden;
    }

    .app-container {
        height: auto;
        min-height: 100vh;
        flex-direction: column;
    }
}

/* Sidebar */
.sidebar {
    width: 260px;
    background: rgba(15, 15, 18, 0.85);
    backdrop-filter: var(--glass-blur);
    border-right: var(--glass-border);
    display: flex;
    flex-direction: column;
    padding-top: 20px;
    z-index: 10;
}

.sidebar-header {
    padding: 0 24px 20px;
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
}

.logo-img {
    height: 36px;
    filter: drop-shadow(0 0 8px rgba(0, 242, 255, 0.5));
}

.logo-text {
    display: flex;
    flex-direction: column;
}

.logo-text span:first-child {
    font-size: 1.2rem;
    font-weight: 700;
    color: #00f2ff;
    letter-spacing: 1px;
}

.logo-text .version {
    font-size: 0.75rem;
    color: var(--primary);
    font-weight: 600;
}

.sidebar-nav {
    flex: 1;
    overflow-y: auto;
    padding: 0 16px;
}

.sidebar-nav::-webkit-scrollbar {
    width: 4px;
}

.sidebar-nav::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 4px;
}

.nav-group {
    margin-top: 24px;
}

.nav-group-title {
    font-size: 0.7rem;
    color: var(--text-muted);
    font-weight: 600;
    letter-spacing: 1px;
    margin-bottom: 8px;
    padding-left: 12px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    color: var(--text-muted);
    text-decoration: none;
    border-radius: 8px;
    margin-bottom: 4px;
    transition: all 0.2s ease;
    font-size: 0.95rem;
    font-weight: 500;
}

.nav-item i {
    width: 20px;
    height: 20px;
    stroke-width: 1.5;
}

.nav-item:hover {
    background: rgba(0, 242, 255, 0.05);
    color: var(--text-main);
}

.nav-item.active {
    background: rgba(0, 242, 255, 0.1);
    color: var(--primary);
    border-left: 3px solid var(--primary);
}

/* Main Content */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    position: relative;
}

.topbar {
    height: 70px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 40px;
    background: rgba(10, 10, 12, 0.6);
    backdrop-filter: var(--glass-blur);
    border-bottom: var(--glass-border);
}

.topbar-left {
    display: flex;
    align-items: center;
    gap: 15px;
}

.mobile-toggle {
    display: none;
    background: none;
    border: none;
    color: var(--text-main);
    cursor: pointer;
    padding: 8px;
    border-radius: 8px;
    transition: background 0.2s;
}

.mobile-toggle:hover {
    background: rgba(255, 255, 255, 0.05);
}

.mobile-toggle i {
    width: 24px;
    height: 24px;
}

.page-title h1 {
    font-size: 1.4rem;
    font-weight: 600;
}

.server-status-pill {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(255, 255, 255, 0.05);
    padding: 6px 16px;
    border-radius: 20px;
    font-size: 0.85rem;
    border: var(--glass-border);
}

.pulse-indicator {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--text-muted);
}

.pulse-indicator.online {
    background: var(--success);
    box-shadow: 0 0 10px var(--success);
}

.pulse-indicator.offline {
    background: var(--danger);
    box-shadow: 0 0 10px var(--danger);
}

/* --- Shared Table & Status Styles --- */
:root {
    --success-neon: #39FF14;
}

.custom-table {
    width: 100%;
    border-collapse: collapse;
}

.custom-table th {
    color: var(--text-muted);
    font-weight: 500;
    font-size: 0.85rem;
    text-transform: uppercase;
    padding: 15px 10px;
    text-align: left;
    background: rgba(255, 255, 255, 0.02);
    border-bottom: 1px solid var(--border-color);
}

.custom-table td {
    padding: 12px 10px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.03);
    font-size: 0.95rem;
    color: var(--text-main);
}

.status-dot {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    margin-right: 8px;
}

.status-online {
    background: var(--success-neon);
    box-shadow: 0 0 8px var(--success-neon);
}

.status-offline {
    background: #475569;
}

.status-banned {
    background: #ef4444;
    box-shadow: 0 0 8px #ef4444, 0 0 14px rgba(239, 68, 68, 0.7);
}

.dot-neon-green {
    width: 10px;
    height: 10px;
    background-color: #2ecc71;
    border-radius: 50%;
    box-shadow: 0 0 8px #2ecc71, 0 0 15px #2ecc71;
}

.dot-neon-magenta {
    width: 10px;
    height: 10px;
    background-color: #e91e63;
    border-radius: 50%;
    box-shadow: 0 0 8px #e91e63, 0 0 15px #e91e63;
}

.view-container {
    flex: 1;
    padding: 40px;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: var(--border-color) transparent;
}

.view-container::-webkit-scrollbar {
    width: 6px;
}

.view-container::-webkit-scrollbar-track {
    background: transparent;
}

.view-container::-webkit-scrollbar-thumb {
    background-color: var(--border-color);
    border-radius: 20px;
}

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

@media (max-width: 992px) {
    .main-content {
        overflow: visible;
        height: auto;
    }

    .view-container {
        overflow: visible;
    }

    .mobile-only {
        display: flex !important;
    }
}

.view-section {
    display: none;
    animation: fadeIn 0.4s ease forwards;
}

.view-section.active {
    display: block;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

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

/* UI Elements */
.glass {
    background: var(--bg-panel);
    backdrop-filter: var(--glass-blur);
    border: var(--glass-border);
    border-radius: 12px;
}

.panel-card {
    padding: 24px;
}

.panel-card.mb-4 {
    margin-bottom: 24px;
}

.panel-card h2 {
    font-size: 1.2rem;
    margin-bottom: 8px;
    color: #fff;
}

.panel-card .desc {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-bottom: 24px;
}

.alert.mb-4 {
    margin-bottom: 24px;
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 24px;
}

.stat-card {
    display: flex;
    align-items: center;
    padding: 24px;
    gap: 20px;
    transition: transform 0.2s;
}

.stat-card:hover {
    transform: translateY(-5px);
}

.stat-icon {
    width: 60px;
    height: 60px;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
}

.stat-icon.orange {
    background: rgba(0, 242, 255, 0.15);
    color: var(--primary);
}

.stat-icon.blue {
    background: rgba(34, 197, 94, 0.15);
    color: var(--success);
}

.stat-icon.purple {
    background: rgba(185, 0, 255, 0.15);
    color: var(--purple);
}

.stat-icon i {
    width: 30px;
    height: 30px;
}

.stat-info h3 {
    font-size: 0.9rem;
    color: var(--text-muted);
    font-weight: 500;
}

.stat-info p {
    font-size: 1.8rem;
    font-weight: 700;
    color: #fff;
    margin-top: 4px;
}

/* Forms */
.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.form-group label {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.form-control {
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    padding: 12px 16px;
    color: #fff;
    font-size: 0.95rem;
    transition: border-color 0.2s;
    width: 100%;
    max-width: 100%;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 2px rgba(0, 242, 255, 0.2);
}

.mt-3 {
    margin-top: 24px;
}

/* Buttons */
.btn {
    padding: 10px 20px;
    border-radius: 8px;
    border: none;
    font-weight: bold;
    font-size: 0.9rem;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.2s;
    text-transform: uppercase;
}

.btn:hover {
    background: var(--primary-hover);
    box-shadow: 0 4px 12px rgba(0, 242, 255, 0.3);
}

.btn i {
    width: 18px;
    height: 18px;
}

.btn-primary {
    background: var(--primary) !important;
    color: #000 !important;
}

.btn-primary:hover {
    background: var(--primary-hover) !important;
    box-shadow: 0 4px 12px rgba(0, 242, 255, 0.3) !important;
}

.btn-danger {
    background: rgba(239, 68, 68, 0.2) !important;
    color: #ef4444 !important;
    border-color: rgba(239, 68, 68, 0.5) !important;
}

.btn-danger:hover {
    background: rgba(239, 68, 68, 0.5) !important;
    color: #ef4444 !important;
    border-color: rgba(239, 68, 68, 0.5) !important;
}

.btn-warning {
    background: rgba(245, 158, 11, 0.2) !important;
    color: #f59e0b !important;
    border-color: rgba(245, 158, 11, 0.5) !important;
}

.btn-warning:hover {
    background: rgba(245, 158, 11, 0.5) !important;
    color: #f59e0b !important;
    border-color: rgba(245, 158, 11, 0.5) !important;
}

.power-buttons {
    display: flex;
    gap: 16px;
}

/* Webhooks List */
.webhooks-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.webhook-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 8px;
    padding: 16px;
    border: var(--glass-border);
}

.webhook-info {
    display: flex;
    align-items: center;
    gap: 16px;
}

.webhook-symbol {
    font-size: 1.5rem;
}

.webhook-details h4 {
    color: #fff;
    font-size: 1rem;
    margin-bottom: 4px;
}

.webhook-details p {
    color: var(--text-muted);
    font-size: 0.8rem;
    font-family: monospace;
}

.periodic-controls {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0 15px;
    padding: 5px 15px;
    border-left: 1px solid var(--border-color);
    border-right: 1px solid var(--border-color);
}

.periodic-controls label {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 0.8rem;
    cursor: pointer;
    color: var(--text-muted);
    white-space: nowrap;
}

.webhook-actions {
    display: flex;
    gap: 12px;
    align-items: center;
    flex: 1;
    justify-content: flex-end;
}

.edit-input {
    width: 60px;
    text-align: center;
}

/* Toasts */
#toast-container {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.toast {
    background: var(--bg-panel);
    border-left: 4px solid var(--primary);
    color: var(--text-main);
    padding: 16px 24px;
    border-radius: 8px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
    border: var(--glass-border);
    backdrop-filter: blur(10px);
    animation: slideIn 0.3s ease forwards;
    display: flex;
    align-items: center;
    gap: 12px;
}

.toast.success {
    border-color: var(--success);
}

.toast.error {
    border-color: var(--danger);
}

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

    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Responsive Grid */
@media (max-width: 1024px) {
    .form-grid {
        grid-template-columns: 1fr;
    }

    .view-container {
        padding: 20px;
    }

    .panel-card {
        padding: 16px;
    }

    .topbar {
        padding: 0 20px;
    }

    .flex-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }

    #btn-save-all {
        width: 100%;
    }
}

@media (max-width: 600px) {
    .view-container {
        padding: 15px;
    }

    .panel-card {
        padding: 12px;
    }

    .form-grid {
        gap: 15px;
    }
}

/* Pill Tags for Scheduler */
.pill-tag {
    display: inline-flex;
    align-items: center;
    background: rgba(0, 242, 255, 0.15);
    border: 1px solid var(--primary);
    color: var(--primary);
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 600;
    gap: 8px;
}

.pill-tag button {
    background: transparent;
    border: none;
    color: var(--primary);
    cursor: pointer;
    font-weight: bold;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s;
}

.pill-tag button:hover {
    color: #fff;
}

/* Login Screen */
.login-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: #020617;
    background-image: radial-gradient(circle at 50% 50%, #0f172a 0%, #020617 100%);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.5s ease, visibility 0.5s;
}

.login-overlay.hidden {
    opacity: 0;
    visibility: hidden;
}

.login-box {
    width: 400px;
    padding: 40px;
    border-radius: 20px;
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(0, 242, 255, 0.1);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    text-align: center;
}

.login-logo {
    height: 150px;
    margin-bottom: 20px;
    filter: drop-shadow(0 0 10px var(--primary));
}

.login-header h2 {
    color: var(--primary);
    margin-bottom: 8px;
    font-size: 1.5rem;
}

.login-header p {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-bottom: 30px;
}

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

.input-group label {
    display: block;
    color: var(--text-main);
    font-size: 0.85rem;
    font-weight: 500;
    margin-bottom: 8px;
}

.input-group input {
    width: 100%;
    padding: 12px 16px;
    background: #020617;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: white;
    outline: none;
    transition: all 0.3s;
}

.input-group input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 2px rgba(0, 242, 255, 0.1);
}

.btn-login {
    width: 100%;
    padding: 14px;
    background: var(--primary);
    border: none;
    border-radius: 8px;
    color: #020617;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s;
    margin-top: 10px;
}

.btn-login:hover {
    background: var(--primary-hover);
    transform: translateY(-2px);
    box-shadow: 0 10px 20px -5px rgba(0, 242, 255, 0.3);
}

.login-error {
    color: var(--danger);
    font-size: 0.85rem;
    margin-top: 15px;
    font-weight: 500;
}

.hidden {
    display: none !important;
}

/* Cards de Veículos (Modal) */
.vehicle-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 15px;
    padding-bottom: 10px;
}

.vehicle-card {
    margin-top: 5px;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    transition: transform 0.2s, border-color 0.2s;
}

.vehicle-card:hover {
    transform: translateY(-3px);
    border-color: var(--primary);
}

.veh-img-wrapper {
    height: 100px;
    background: rgba(0, 0, 0, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 15px;
    border-radius: 10px;
}

.veh-img-wrapper img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    filter: drop-shadow(0 5px 10px rgba(0, 0, 0, 0.4));
}

.veh-details {
    padding: 15px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    flex: 1;
}

.veh-details h4 {
    color: var(--primary);
    font-size: 1.1rem;
    margin-bottom: 5px;
}

.veh-id,
.veh-date {
    color: var(--text-muted);
    font-size: 0.8rem;
    margin: 0;
}

.veh-actions {
    margin-top: auto;
}

.veh-actions .btn {
    width: 100%;
    font-size: 0.85rem;
    padding: 8px;
    text-transform: none;
}

/* Sidebar Overlay */
#sidebar-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    z-index: 99;
    display: none;
    opacity: 0;
    transition: opacity 0.3s ease;
}

#sidebar-overlay.active {
    display: block;
    opacity: 1;
}

/* --- UTILITY CLASSES FOR RESPONSIVENESS --- */
.flex-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 15px;
}

.table-responsive {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin-top: 10px;
}

/* Mobile Responsive */
@media (max-width: 992px) {
    .flex-header {
        flex-direction: column;
        align-items: stretch;
        text-align: left;
    }

    .sidebar {
        position: fixed;
        left: 0;
        top: 0;
        bottom: 0;
        transform: translateX(-100%);
        transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        width: 280px;
        box-shadow: 20px 0 50px rgba(0, 0, 0, 0.5);
        z-index: 100;
    }

    .sidebar.active {
        transform: translateX(0);
    }

    .main-content {
        width: 100vw;
    }

    .topbar {
        padding: 0 20px;
        position: sticky;
        top: 0;
        z-index: 50;
    }

    .mobile-toggle {
        display: block;
    }

    .view-container {
        padding: 20px 15px;
        overflow-x: hidden;
    }

    .stats-grid {
        grid-template-columns: 1fr;
    }

    .form-grid {
        grid-template-columns: 1fr !important;
    }

    .form-control {
        width: 100%;
        max-width: 100%;
    }

    .power-buttons {
        flex-direction: column;
        width: 100%;
    }

    .btn {
        width: 100%;
        padding: 14px 20px;
        /* Alvos de toque maiores */
    }

    /* Esconder colunas não essenciais em dispositivos móveis */
    .hide-mobile {
        display: none !important;
    }

    .flex-header {
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
    }

    .full-width-mobile {
        width: 100% !important;
        max-width: 100% !important;
    }

    .search-box-responsive {
        width: 100% !important;
        margin-bottom: 10px;
    }
}

/* --- Novos Componentes de UI (Desktop & Mobile) --- */

/* Emoji Picker */
.emoji-picker {
    position: absolute;
    z-index: 1100;
    width: 250px;
    background: rgba(15, 23, 42, 0.98);
    border: 1px solid var(--primary);
    border-radius: 12px;
    padding: 10px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(10px);
}

.emoji-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 5px;
    max-height: 200px;
    overflow-y: auto;
}

.emoji-btn {
    background: transparent;
    border: none;
    font-size: 1.4rem;
    padding: 5px;
    cursor: pointer;
    border-radius: 6px;
    transition: background 0.2s;
}

.emoji-btn:hover {
    background: rgba(0, 242, 255, 0.2);
}

/* Novo Layout de Webhook (Compacto) */
.webhooks-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.webhook-item {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 12px 20px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    transition: all 0.2s;
}

.webhook-item:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(0, 242, 255, 0.3);
}

.webhook-label {
    min-width: 150px;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-muted);
}

.webhook-input-group {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1;
}

.webhook-btn-group {
    display: flex;
    gap: 8px;
}

.btn-icon {
    width: 46px;
    height: 46px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: white;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-icon:hover {
    background: var(--primary);
    color: black;
    border-color: var(--primary);
}

@media (max-width: 768px) {
    .vehicle-grid {
        grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
        gap: 15px;
    }

    .veh-img-wrapper {
        height: 100px;
        padding: 8px;
    }

    .veh-details {
        padding: 10px;
        gap: 4px;
    }

    .veh-details h4 {
        font-size: 0.95rem;
    }

    .veh-id,
    .veh-date {
        font-size: 0.75rem;
    }

    .webhook-item {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
    }

    .webhook-label {
        min-width: unset;
        border-bottom: 1px solid rgba(255, 255, 255, 0.05);
        padding-bottom: 5px;
    }

    .mobile-only {
        display: flex !important;
    }

    .veh-actions {
        flex-wrap: wrap;
        gap: 8px;
    }

    .veh-actions .btn {
        width: 100% !important;
        min-width: 0 !important;
        flex: none;
    }
}

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

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

.modal-header h3 {
    margin: 0;
    color: var(--primary);
    font-size: 1.3rem;
    font-weight: 700;
}

.modal-header p {
    margin: 0;
    font-size: 0.85rem;
    color: var(--text-muted);
}

.modal-body {
    display: flex;
    flex-direction: column;
    gap: 20px;
    padding-top: 10px;
}

.btn-close {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 2rem;
    cursor: pointer;
    line-height: 1;
    padding: 0;
    transition: color 0.2s;
}

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

.modal-footer {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-top: 25px;
}

@media (max-width: 480px) {
    .login-box {
        width: 90%;
        padding: 24px;
    }

    .panel-card {
        padding: 16px;
    }

    .page-title h1 {
        font-size: 1.1rem;
    }
}

/* Standard Actions in Tables */
.btn-table-action {
    width: 55px;
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    cursor: pointer;
}

.btn-table-action:hover {
    transform: translateY(-2px);
    filter: brightness(1.2);
}

.btn-table-action i {
    width: 14px !important;
    height: 14px !important;
    stroke-width: 2.5;
}

/* Custom Tooltips (Pure CSS) */
[data-tooltip] {
    position: relative;
    cursor: pointer;
}

/* Tooltip Box */
[data-tooltip]::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 130%;
    left: 0;
    transform: translateY(6px);
    padding: 8px 12px;
    background: rgba(15, 23, 42, 0.98);
    color: #f8fafc;
    font-size: 0.76rem;
    font-weight: 500;
    line-height: 1.4;
    border-radius: 6px;
    white-space: normal;
    min-width: 200px;
    max-width: 290px;
    width: max-content;
    word-break: break-word;
    opacity: 0;
    visibility: hidden;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1px solid var(--primary);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.7);
    z-index: 9999;
    pointer-events: none;
}

/* Tooltip Arrow */
[data-tooltip]::before {
    content: '';
    position: absolute;
    bottom: 115%;
    left: 8px;
    transform: translateY(6px);
    border: 6px solid transparent;
    border-top-color: var(--primary);
    opacity: 0;
    visibility: hidden;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 9999;
    pointer-events: none;
}

/* Show on Hover */
[data-tooltip]:hover::after,
[data-tooltip]:hover::before {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

@media (max-width: 768px) {
    [data-tooltip]::after {
        left: -10px;
        max-width: 220px;
        font-size: 0.72rem;
    }
}

/* --- Dashboard Charts --- */
.charts-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(450px, 1fr));
    gap: 24px;
    margin-top: 30px;
    padding-bottom: 40px;
}

@media (max-width: 600px) {
    .charts-container {
        grid-template-columns: 1fr;
    }
}

.chart-card {
    display: flex;
    flex-direction: column;
    padding: 24px;
    min-height: 400px;
    transition: transform 0.3s ease;
}

.chart-card:hover {
    transform: translateY(-5px);
    border-color: var(--primary);
}

.chart-card .card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 24px;
}

.chart-card .header-info h2 {
    font-size: 1.1rem;
    color: #fff;
    margin-bottom: 4px;
    letter-spacing: 0.5px;
}

.chart-card .header-info .desc {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.chart-wrapper {
    flex: 1;
    position: relative;
    width: 100%;
    min-height: 280px;
}

.filter-select {
    width: 170px;
    padding: 8px 12px;
    font-size: 0.85rem;
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid var(--border-color);
    cursor: pointer;
}

.filter-select option {
    background: var(--bg-panel);
    color: #fff;
}

/* --- Scheduler Switch --- */
.sched-switch {
    position: relative;
    display: inline-block;
    width: 48px;
    height: 24px;
}

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

.sched-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: var(--danger);
    /* red when deactivated */
    box-shadow: 0 0 10px rgba(239, 68, 68, 0.3);
    transition: .3s;
    border-radius: 24px;
}

.sched-slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: .3s;
    border-radius: 50%;
}

.sched-switch input:checked+.sched-slider {
    background-color: var(--success-neon);
    box-shadow: 0 0 10px var(--success-neon);
}

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

.disabled-section {
    opacity: 0.4;
    pointer-events: none;
    user-select: none;
    transition: opacity 0.3s ease;
}