/* ==========================================================================
   FV STREAMING ERP - DARK THEME & RESPONSIVE APP STYLES
   ========================================================================== */

:root {
    --bg-main: #0b0f19;
    --bg-card: #111827;
    --bg-card-hover: #1f2937;
    --bg-input: #1e293b;
    --border-color: #334155;
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    
    --primary: #e50914; /* Netflix Red */
    --primary-hover: #b80710;
    --accent-cyan: #06b6d4;
    --accent-emerald: #10b981;
    --accent-amber: #f59e0b;
    --accent-orange: #f97316;
    --accent-indigo: #6366f1;

    --status-active: #10b981;
    --status-today: #f97316;
    --status-tomorrow: #eab308;
    --status-warning: #facc15;
    --status-expired: #ef4444;
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background-color: var(--bg-main);
    color: var(--text-main);
    line-height: 1.5;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    padding-bottom: 75px; /* Spacing for mobile bottom nav */
}

@media (min-width: 768px) {
    body {
        padding-bottom: 0;
    }
}

a {
    color: inherit;
    text-decoration: none;
}

/* NAVBAR */
.navbar {
    background: rgba(17, 24, 39, 0.85);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 50;
    padding: 0.75rem 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.brand {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    font-size: 1.25rem;
    font-weight: 800;
    letter-spacing: -0.5px;
}

.brand-badge {
    background: linear-gradient(135deg, #e50914, #ff3366);
    color: #fff;
    font-size: 0.75rem;
    font-weight: 700;
    padding: 0.2rem 0.5rem;
    border-radius: 6px;
    text-transform: uppercase;
}

.nav-links {
    display: none;
    gap: 0.5rem;
}

@media (min-width: 768px) {
    .nav-links {
        display: flex;
        align-items: center;
    }
}

.nav-link {
    padding: 0.5rem 0.9rem;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-muted);
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.nav-link:hover, .nav-link.active {
    color: var(--text-main);
    background: rgba(255, 255, 255, 0.08);
}

.nav-link.active {
    color: #fff;
    background: var(--primary);
}

.user-menu {
    display: flex;
    align-items: center;
    gap: 0.8rem;
}

.logout-btn {
    background: #334155;
    color: #fff;
    padding: 0.35rem 0.75rem;
    border-radius: 6px;
    font-size: 0.8rem;
    border: none;
    cursor: pointer;
}

.logout-btn:hover {
    background: #475569;
}

/* MOBILE BOTTOM BAR */
.mobile-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 65px;
    background: rgba(15, 23, 42, 0.95);
    backdrop-filter: blur(16px);
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: space-around;
    align-items: center;
    z-index: 45;
}

@media (min-width: 768px) {
    .mobile-nav {
        display: none;
    }
}

.mobile-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--text-muted);
    padding: 0.4rem 0.6rem;
    border-radius: 8px;
    transition: 0.2s;
}

.mobile-nav-item.active {
    color: var(--primary);
}

.mobile-nav-item svg {
    width: 22px;
    height: 22px;
    margin-bottom: 2px;
}

/* LAYOUT CONTAINER */
.container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 1.5rem 1rem;
    width: 100%;
}

/* PAGE HEADER */
.page-header {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.page-title {
    font-size: 1.6rem;
    font-weight: 800;
    letter-spacing: -0.5px;
}

.page-subtitle {
    color: var(--text-muted);
    font-size: 0.88rem;
    margin-top: 0.2rem;
}

/* BUTTONS */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.6rem 1.2rem;
    font-size: 0.9rem;
    font-weight: 600;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.btn-primary {
    background: linear-gradient(135deg, #e50914, #ff2a4a);
    color: #fff;
    box-shadow: 0 4px 14px rgba(229, 9, 20, 0.35);
}

.btn-primary:hover {
    background: linear-gradient(135deg, #cc0812, #e61e3d);
    transform: translateY(-1px);
}

.btn-secondary {
    background: #1e293b;
    color: #cbd5e1;
    border: 1px solid var(--border-color);
}

.btn-secondary:hover {
    background: #334155;
    color: #fff;
}

.btn-success {
    background: #059669;
    color: #fff;
}

.btn-success:hover {
    background: #047857;
}

.btn-danger {
    background: #dc2626;
    color: #fff;
}

.btn-danger:hover {
    background: #b91c1c;
}

.btn-whatsapp {
    background: #25D366;
    color: #fff;
    font-weight: 700;
}

.btn-whatsapp:hover {
    background: #20ba5a;
}

.btn-sm {
    padding: 0.35rem 0.65rem;
    font-size: 0.78rem;
    border-radius: 6px;
}

/* CARDS */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 1.25rem;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.25);
    margin-bottom: 1.5rem;
}

/* KPI STATS GRID */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 1.1rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    transition: transform 0.2s;
}

.stat-card:hover {
    transform: translateY(-2px);
    border-color: #475569;
}

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

.stat-info .stat-value {
    font-size: 1.6rem;
    font-weight: 800;
    line-height: 1.1;
}

.stat-info .stat-label {
    font-size: 0.8rem;
    color: var(--text-muted);
    font-weight: 500;
    margin-top: 0.2rem;
}

/* SEMAFORO BADGES */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.25rem 0.65rem;
    font-size: 0.75rem;
    font-weight: 700;
    border-radius: 9999px;
    letter-spacing: 0.3px;
    white-space: nowrap;
}

.badge-success {
    background: rgba(16, 185, 129, 0.15);
    color: #34d399;
    border: 1px solid rgba(16, 185, 129, 0.3);
}

.badge-warning {
    background: rgba(250, 204, 21, 0.15);
    color: #fde047;
    border: 1px solid rgba(250, 204, 21, 0.3);
}

.badge-tomorrow {
    background: rgba(234, 179, 8, 0.15);
    color: #facc15;
    border: 1px solid rgba(234, 179, 8, 0.3);
}

.badge-today {
    background: rgba(249, 115, 22, 0.2);
    color: #fb923c;
    border: 1px solid rgba(249, 115, 22, 0.4);
    animation: pulseGlow 2s infinite;
}

.badge-danger {
    background: rgba(239, 68, 68, 0.2);
    color: #f87171;
    border: 1px solid rgba(239, 68, 68, 0.4);
}

@keyframes pulseGlow {
    0%, 100% { box-shadow: 0 0 0 rgba(249, 115, 22, 0); }
    50% { box-shadow: 0 0 8px rgba(249, 115, 22, 0.4); }
}

/* TABLE */
.table-responsive {
    overflow-x: auto;
    border-radius: 10px;
    border: 1px solid var(--border-color);
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
    font-size: 0.88rem;
}

.data-table th {
    background: #1e293b;
    padding: 0.85rem 1rem;
    font-weight: 700;
    color: #94a3b8;
    text-transform: uppercase;
    font-size: 0.72rem;
    letter-spacing: 0.5px;
    border-bottom: 1px solid var(--border-color);
}

.data-table td {
    padding: 0.85rem 1rem;
    border-bottom: 1px solid rgba(51, 65, 85, 0.5);
    vertical-align: middle;
}

.data-table tr:hover td {
    background: rgba(255, 255, 255, 0.02);
}

/* FORM CONTROLS */
.form-group {
    margin-bottom: 1.1rem;
}

.form-label {
    display: block;
    font-size: 0.82rem;
    font-weight: 600;
    color: #cbd5e1;
    margin-bottom: 0.35rem;
}

.form-control {
    width: 100%;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 0.65rem 0.9rem;
    color: #fff;
    font-size: 0.9rem;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.form-control:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(229, 9, 20, 0.25);
}

/* POS SPECIAL UI */
.platform-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
    gap: 0.75rem;
    margin-bottom: 1.5rem;
}

.platform-btn {
    background: var(--bg-card);
    border: 2px solid var(--border-color);
    border-radius: 12px;
    padding: 0.85rem 0.5rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
    text-align: center;
}

.platform-btn:hover {
    border-color: #64748b;
    transform: translateY(-2px);
}

.platform-btn.selected {
    border-color: var(--primary);
    background: rgba(229, 9, 20, 0.12);
    box-shadow: 0 0 16px rgba(229, 9, 20, 0.3);
}

.platform-btn .platform-name {
    font-weight: 700;
    font-size: 0.85rem;
    margin-top: 0.35rem;
}

.platform-btn .platform-price {
    font-size: 0.8rem;
    color: var(--accent-emerald);
    font-weight: 700;
    margin-top: 0.2rem;
}

/* MODAL */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(8px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 100;
    padding: 1rem;
    opacity: 0;
    transition: opacity 0.2s ease-in-out;
}

.modal-overlay.show {
    display: flex;
    opacity: 1;
}

.modal-content {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 14px;
    width: 100%;
    max-width: 580px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.6);
    transform: scale(0.95);
    transition: transform 0.2s ease-in-out;
}

.modal-overlay.show .modal-content {
    transform: scale(1);
}

.modal-header {
    padding: 1.1rem 1.4rem;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.modal-title {
    font-size: 1.2rem;
    font-weight: 800;
}

.modal-close {
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 1.5rem;
    cursor: pointer;
    line-height: 1;
}

.modal-close:hover {
    color: #fff;
}

.modal-body {
    padding: 1.4rem;
}

.modal-footer {
    padding: 1rem 1.4rem;
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
}

/* SEARCH & FILTER BAR */
.filter-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    align-items: center;
    margin-bottom: 1.25rem;
}

.search-input-wrap {
    flex: 1;
    min-width: 240px;
    position: relative;
}

.filter-tabs {
    display: flex;
    gap: 0.35rem;
    overflow-x: auto;
    padding-bottom: 4px;
}

.filter-tab {
    padding: 0.4rem 0.8rem;
    border-radius: 8px;
    background: #1e293b;
    color: var(--text-muted);
    font-size: 0.8rem;
    font-weight: 600;
    border: 1px solid var(--border-color);
    cursor: pointer;
    white-space: nowrap;
    transition: 0.2s;
}

.filter-tab:hover, .filter-tab.active {
    background: #334155;
    color: #fff;
}

.filter-tab.active {
    border-color: var(--primary);
    background: rgba(229, 9, 20, 0.15);
    color: #fff;
}
