/* ======================================
   USA PANEL - Design System
   Inspired by Flup Furniture Dashboard
   ====================================== */

/* ---- Fonts ---- */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');

/* ---- CSS Variables ---- */
:root {
    --primary: #004D40;
    --primary-light: #00695C;
    --primary-lighter: rgba(0, 77, 64, 0.08);
    --primary-rgb: 0, 77, 64;
    --accent: #00BFA5;
    --accent-light: rgba(0, 191, 165, 0.12);

    --bg-body: #F4F6F9;
    --bg-card: #FFFFFF;
    --bg-sidebar: #0A1929;
    --bg-sidebar-hover: rgba(255, 255, 255, 0.06);
    --bg-sidebar-active: rgba(0, 191, 165, 0.12);
    --bg-input: #F8FAFC;

    --text-primary: #1E293B;
    --text-secondary: #475569;
    --text-muted: #94A3B8;
    --text-sidebar: #B0BEC5;
    --text-sidebar-active: #00BFA5;
    --text-white: #FFFFFF;

    --border: #E2E8F0;
    --border-light: #F1F5F9;

    --success: #22C55E;
    --success-bg: rgba(34, 197, 94, 0.1);
    --warning: #F59E0B;
    --warning-bg: rgba(245, 158, 11, 0.1);
    --danger: #EF4444;
    --danger-bg: rgba(239, 68, 68, 0.1);
    --info: #3B82F6;
    --info-bg: rgba(59, 130, 246, 0.1);

    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 14px;
    --radius-xl: 20px;

    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.04);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.08);
    --shadow-xl: 0 12px 40px rgba(0, 0, 0, 0.12);

    --sidebar-width: 260px;
    --sidebar-collapsed: 70px;
    --header-height: 64px;

    --transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ---- Reset ---- */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 14px;
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg-body);
    color: var(--text-primary);
    line-height: 1.6;
    overflow-x: hidden;
}

a { color: var(--primary); text-decoration: none; }
a:hover { color: var(--primary-light); }

/* ---- Layout ---- */
.app-layout {
    display: flex;
    min-height: 100vh;
}

.main-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    transition: var(--transition);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.page-content {
    padding: 24px 28px;
    flex: 1;
    max-width: 1400px;
    width: 100%;
    margin: 0 auto;
}

/* ======= SIDEBAR ======= */
.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: var(--sidebar-width);
    height: 100vh;
    background: var(--bg-sidebar);
    z-index: 1000;
    transition: var(--transition);
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    overflow-x: hidden;
}

.sidebar-brand {
    padding: 20px 22px;
    display: flex;
    align-items: center;
    gap: 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    min-height: 65px;
}

.sidebar-brand .brand-icon {
    width: 38px;
    height: 38px;
    background: linear-gradient(135deg, var(--accent) 0%, var(--primary) 100%);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    color: white;
    flex-shrink: 0;
}

.sidebar-brand .brand-text {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--text-white);
    white-space: nowrap;
    letter-spacing: -0.02em;
}

.sidebar-brand .brand-text span {
    color: var(--accent);
}

.sidebar-section-title {
    padding: 20px 22px 8px;
    font-size: 0.68rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1.2px;
    color: rgba(255, 255, 255, 0.3);
    white-space: nowrap;
}

.sidebar-nav {
    list-style: none;
    padding: 4px 10px;
    flex: 1;
}

.sidebar-nav li {
    margin-bottom: 2px;
}

.sidebar-nav a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    color: var(--text-sidebar);
    border-radius: var(--radius-md);
    transition: var(--transition);
    font-size: 0.9rem;
    font-weight: 500;
    white-space: nowrap;
}

.sidebar-nav a:hover {
    background: var(--bg-sidebar-hover);
    color: var(--text-white);
}

.sidebar-nav a.active {
    background: var(--bg-sidebar-active);
    color: var(--text-sidebar-active);
    font-weight: 600;
}

.sidebar-nav a i {
    font-size: 1.25rem;
    width: 24px;
    text-align: center;
    flex-shrink: 0;
}

.sidebar-nav a .nav-label {
    white-space: nowrap;
    overflow: hidden;
}

.sidebar-footer {
    padding: 14px 16px;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.sidebar-user {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    border-radius: var(--radius-md);
    transition: var(--transition);
}

.sidebar-user:hover {
    background: var(--bg-sidebar-hover);
}

.sidebar-user .user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent) 0%, var(--primary) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 700;
    font-size: 0.85rem;
    flex-shrink: 0;
}

.sidebar-user .user-info {
    overflow: hidden;
}

.sidebar-user .user-name {
    color: var(--text-white);
    font-weight: 600;
    font-size: 0.85rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sidebar-user .user-role {
    color: var(--accent);
    font-size: 0.72rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* ======= HEADER ======= */
.header {
    height: var(--header-height);
    background: var(--bg-card);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 28px;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: var(--shadow-sm);
}

.header-left {
    display: flex;
    align-items: center;
    gap: 16px;
}

.header-left .page-title {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--text-primary);
}

.header-left .page-subtitle {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: 1px;
}

.sidebar-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 1.4rem;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 6px;
    border-radius: var(--radius-sm);
}

.sidebar-toggle:hover {
    background: var(--bg-input);
}

.header-right {
    display: flex;
    align-items: center;
    gap: 8px;
}

.header-btn {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    border: none;
    background: var(--bg-input);
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.15rem;
    transition: var(--transition);
}

.header-btn:hover {
    background: var(--primary-lighter);
    color: var(--primary);
}

/* ======= CARDS ======= */
.card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-light);
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
    overflow: hidden;
}

.card:hover {
    box-shadow: var(--shadow-md);
}

.card-header {
    padding: 18px 22px;
    border-bottom: 1px solid var(--border-light);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.card-title {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 8px;
}

.card-title i {
    font-size: 1.2rem;
    color: var(--primary);
}

.card-body {
    padding: 22px;
}

.card-footer {
    padding: 14px 22px;
    border-top: 1px solid var(--border-light);
    background: var(--bg-input);
}

/* ======= STAT CARDS ======= */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 18px;
    margin-bottom: 24px;
}

.stat-card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: 22px;
    border: 1px solid var(--border-light);
    box-shadow: var(--shadow-sm);
    display: flex;
    align-items: center;
    gap: 16px;
    transition: var(--transition);
}

.stat-card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.stat-icon {
    width: 52px;
    height: 52px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    flex-shrink: 0;
}

.stat-icon.primary { background: var(--primary-lighter); color: var(--primary); }
.stat-icon.success { background: var(--success-bg); color: var(--success); }
.stat-icon.warning { background: var(--warning-bg); color: var(--warning); }
.stat-icon.danger { background: var(--danger-bg); color: var(--danger); }
.stat-icon.info { background: var(--info-bg); color: var(--info); }

.stat-value {
    font-size: 1.6rem;
    font-weight: 800;
    color: var(--text-primary);
    line-height: 1.2;
}

.stat-label {
    font-size: 0.78rem;
    color: var(--text-muted);
    font-weight: 500;
    margin-top: 2px;
}

/* ======= TABLES ======= */
.table-wrapper {
    overflow-x: auto;
    border-radius: var(--radius-md);
}

table.table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
}

table.table thead th {
    background: var(--bg-input);
    border-bottom: 2px solid var(--border);
    padding: 12px 14px;
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    color: var(--text-muted);
    white-space: nowrap;
    text-align: left;
}

table.table tbody td {
    padding: 12px 14px;
    border-bottom: 1px solid var(--border-light);
    font-size: 0.85rem;
    color: var(--text-secondary);
    vertical-align: middle;
}

table.table tbody tr {
    transition: var(--transition);
}

table.table tbody tr:hover {
    background: var(--primary-lighter);
}

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

/* ======= BADGES ======= */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 5px 14px;
    border-radius: 50px;
    font-size: 0.8rem;
    font-weight: 600;
    white-space: nowrap;
}

.badge-success { background: var(--success-bg); color: #16A34A; }
.badge-warning { background: var(--warning-bg); color: #D97706; }
.badge-danger { background: var(--danger-bg); color: #DC2626; }
.badge-info { background: var(--info-bg); color: #2563EB; }
.badge-secondary { background: rgba(148, 163, 184, 0.12); color: var(--text-muted); }
.badge-primary { background: var(--primary-lighter); color: var(--primary); }

/* ======= BUTTONS ======= */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 20px;
    border-radius: var(--radius-md);
    font-size: 0.85rem;
    font-weight: 600;
    border: none;
    cursor: pointer;
    transition: var(--transition);
    white-space: nowrap;
    font-family: inherit;
    line-height: 1.4;
}

.btn i { font-size: 1.1rem; }

.btn-primary {
    background: var(--primary);
    color: white;
    box-shadow: 0 2px 8px rgba(0, 77, 64, 0.25);
}
.btn-primary:hover {
    background: var(--primary-light);
    box-shadow: 0 4px 14px rgba(0, 77, 64, 0.35);
    transform: translateY(-1px);
    color: white;
}

.btn-success {
    background: var(--success);
    color: white;
    box-shadow: 0 2px 8px rgba(34, 197, 94, 0.25);
}
.btn-success:hover {
    background: #16A34A;
    color: white;
}

.btn-danger {
    background: var(--danger);
    color: white;
}
.btn-danger:hover {
    background: #DC2626;
    color: white;
}

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

.btn-secondary {
    background: var(--bg-input);
    color: var(--text-secondary);
    border: 1px solid var(--border);
}
.btn-secondary:hover {
    background: var(--border);
    color: var(--text-primary);
}

.btn-sm {
    padding: 6px 12px;
    font-size: 0.78rem;
}

.btn-lg {
    padding: 13px 28px;
    font-size: 0.95rem;
}

.btn-icon {
    width: 36px;
    height: 36px;
    padding: 0;
    border-radius: var(--radius-md);
}

.btn-icon i { font-size: 1.15rem; }

/* ======= FORMS ======= */
.form-group {
    margin-bottom: 18px;
}

.form-label {
    display: block;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 6px;
}

.form-control {
    width: 100%;
    padding: 10px 14px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-md);
    font-size: 0.85rem;
    font-family: inherit;
    color: var(--text-primary);
    background: var(--bg-input);
    transition: var(--transition);
}

.form-control:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(0, 77, 64, 0.1);
    background: white;
}

.form-control::placeholder {
    color: var(--text-muted);
}

select.form-control {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath d='M0 0l5 6 5-6H0z' fill='%2394A3B8'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 36px;
}

textarea.form-control {
    resize: vertical;
    min-height: 80px;
}

.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
}

/* ======= MODALS ======= */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(4px);
    z-index: 9999;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
    animation: fadeIn 0.2s ease;
}

.modal-overlay.active {
    display: flex;
}

.modal-content {
    background: var(--bg-card);
    border-radius: var(--radius-xl);
    width: 100%;
    max-width: 520px;
    max-height: 85vh;
    overflow-y: auto;
    box-shadow: var(--shadow-xl);
    animation: slideUp 0.3s ease;
}

.modal-header {
    padding: 20px 24px;
    border-bottom: 1px solid var(--border-light);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.modal-header h3 {
    font-size: 1.1rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 8px;
}

.modal-header h3 i {
    color: var(--primary);
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.3rem;
    color: var(--text-muted);
    cursor: pointer;
    padding: 4px;
    border-radius: var(--radius-sm);
    transition: var(--transition);
}

.modal-close:hover {
    background: var(--danger-bg);
    color: var(--danger);
}

.modal-body {
    padding: 24px;
}

.modal-footer {
    padding: 16px 24px;
    border-top: 1px solid var(--border-light);
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

/* ======= TOAST ======= */
.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 99999;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.toast {
    background: var(--bg-card);
    border-radius: var(--radius-md);
    padding: 14px 20px;
    box-shadow: var(--shadow-lg);
    display: flex;
    align-items: center;
    gap: 10px;
    animation: slideRight 0.3s ease;
    min-width: 280px;
    max-width: 400px;
    border-left: 4px solid var(--primary);
}

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

.toast i { font-size: 1.3rem; }
.toast.success i { color: var(--success); }
.toast.error i { color: var(--danger); }
.toast.warning i { color: var(--warning); }

.toast-message {
    font-size: 0.85rem;
    color: var(--text-primary);
    font-weight: 500;
    flex: 1;
}

.toast-close {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 1rem;
    padding: 2px;
}

/* ======= EMPTY STATE ======= */
.empty-state {
    text-align: center;
    padding: 40px 20px;
}

.empty-state i {
    font-size: 3.5rem;
    color: var(--text-muted);
    opacity: 0.4;
}

.empty-state p {
    margin-top: 12px;
    color: var(--text-muted);
    font-size: 0.9rem;
}

/* ======= CREDITS TABLE ======= */
.credit-cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 14px;
}

.credit-card {
    background: var(--bg-input);
    border-radius: var(--radius-md);
    padding: 16px;
    border: 1px solid var(--border-light);
    transition: var(--transition);
}

.credit-card:hover {
    border-color: var(--primary);
    box-shadow: var(--shadow-sm);
}

.credit-card .pkg-name {
    font-weight: 700;
    font-size: 0.9rem;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.credit-card .pkg-duration {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-bottom: 10px;
}

.credit-card .credit-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 4px 0;
    font-size: 0.82rem;
}

.credit-card .credit-row .label {
    color: var(--text-muted);
}

.credit-card .credit-row .value {
    font-weight: 700;
    color: var(--primary);
}

/* ======= CODE RESULTS ======= */
.codes-result {
    margin-top: 20px;
}

.code-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: var(--bg-input);
    border-radius: var(--radius-md);
    margin-bottom: 8px;
    border: 1px solid var(--border-light);
    font-family: 'SF Mono', 'Fira Code', 'Courier New', monospace;
    font-size: 0.82rem;
    transition: var(--transition);
}

.code-item:hover {
    border-color: var(--primary);
}

.code-item .code-text {
    font-weight: 700;
    color: var(--primary);
    min-width: 100px;
}

.code-item .code-user {
    color: var(--text-secondary);
}

.code-item .code-pass {
    color: var(--text-muted);
}

.code-item .code-copy {
    margin-left: auto;
    cursor: pointer;
    color: var(--text-muted);
    transition: var(--transition);
}

.code-item .code-copy:hover {
    color: var(--primary);
}

/* ======= ACTION BUTTONS ROW ======= */
.page-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 20px;
}

/* ======= GRID LAYOUTS ======= */
.grid-2 {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
}

.grid-3 {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}

/* ======= UTILITY ======= */
.mb-3 { margin-bottom: 16px; }
.mb-4 { margin-bottom: 20px; }
.mb-5 { margin-bottom: 28px; }
.mt-3 { margin-top: 16px; }
.mt-4 { margin-top: 20px; }
.gap-2 { gap: 10px; }
.gap-3 { gap: 16px; }
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-muted { color: var(--text-muted); }
.text-success { color: var(--success); }
.text-danger { color: var(--danger); }
.text-warning { color: var(--warning); }
.text-primary { color: var(--primary); }
.font-mono { font-family: 'SF Mono', 'Fira Code', monospace; }
.w-100 { width: 100%; }
.d-flex { display: flex; }
.align-center { align-items: center; }
.justify-between { justify-content: space-between; }
.flex-wrap { flex-wrap: wrap; }

/* ======= ANIMATIONS ======= */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

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

@keyframes slideRight {
    from { opacity: 0; transform: translateX(40px); }
    to { opacity: 1; transform: translateX(0); }
}

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

/* ======= LOGIN PAGE ======= */
.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #0A1929 0%, #004D40 50%, #00695C 100%);
    padding: 20px;
    position: relative;
    overflow: hidden;
}

.login-page::before {
    content: '';
    position: absolute;
    width: 300px;
    height: 300px;
    border-radius: 50%;
    background: rgba(0, 191, 165, 0.08);
    top: -50px;
    right: -50px;
    animation: pulse 4s ease-in-out infinite;
}

.login-page::after {
    content: '';
    position: absolute;
    width: 200px;
    height: 200px;
    border-radius: 50%;
    background: rgba(0, 191, 165, 0.05);
    bottom: -30px;
    left: -30px;
    animation: pulse 5s ease-in-out infinite reverse;
}

.login-card {
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-xl);
    padding: 40px 36px;
    width: 100%;
    max-width: 420px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    position: relative;
    z-index: 1;
    animation: slideUp 0.5s ease;
}

.login-card .login-logo {
    width: 64px;
    height: 64px;
    border-radius: var(--radius-lg);
    background: linear-gradient(135deg, var(--accent) 0%, var(--primary) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
    font-size: 1.8rem;
    color: white;
}

.login-card h1 {
    text-align: center;
    color: white;
    font-size: 1.6rem;
    font-weight: 800;
    margin-bottom: 6px;
}

.login-card .login-subtitle {
    text-align: center;
    color: rgba(255, 255, 255, 0.5);
    font-size: 0.85rem;
    margin-bottom: 28px;
}

.login-card .form-label {
    color: rgba(255, 255, 255, 0.7);
}

.login-card .form-control {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(255, 255, 255, 0.12);
    color: white;
}

.login-card .form-control:focus {
    background: rgba(255, 255, 255, 0.1);
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(0, 191, 165, 0.15);
}

.login-card .form-control::placeholder {
    color: rgba(255, 255, 255, 0.3);
}

.login-card .btn-primary {
    width: 100%;
    padding: 13px;
    font-size: 0.95rem;
    background: linear-gradient(135deg, var(--accent) 0%, var(--primary) 100%);
    box-shadow: 0 4px 16px rgba(0, 191, 165, 0.3);
    margin-top: 8px;
}

.login-card .btn-primary:hover {
    box-shadow: 0 6px 24px rgba(0, 191, 165, 0.45);
    transform: translateY(-2px);
}

.login-error {
    background: rgba(239, 68, 68, 0.12);
    border: 1px solid rgba(239, 68, 68, 0.25);
    color: #FCA5A5;
    padding: 12px 16px;
    border-radius: var(--radius-md);
    margin-bottom: 20px;
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* ======= ERROR PAGE ======= */
.error-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 60vh;
    text-align: center;
}

.error-page h1 {
    font-size: 4rem;
    font-weight: 800;
    color: var(--primary);
    margin-bottom: 10px;
}

/* ======= RESPONSIVE ======= */
@media (max-width: 1024px) {
    .grid-3 {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
    }

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

    .main-content {
        margin-left: 0;
    }

    .sidebar-toggle {
        display: flex;
    }

    .header {
        padding: 0 16px;
    }

    .page-content {
        padding: 16px;
    }

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

    .stat-card {
        padding: 16px;
    }

    .stat-icon {
        width: 42px;
        height: 42px;
        font-size: 1.2rem;
    }

    .stat-value {
        font-size: 1.3rem;
    }

    .grid-2, .grid-3 {
        grid-template-columns: 1fr;
    }

    .page-actions {
        flex-direction: column;
    }

    .page-actions .btn {
        width: 100%;
    }

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

    .card-header {
        flex-wrap: wrap;
    }

    .modal-content {
        max-width: 100%;
        margin: 10px;
        border-radius: var(--radius-lg);
    }

    table.table thead th,
    table.table tbody td {
        padding: 10px 8px;
        font-size: 0.78rem;
    }
}

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

    .stat-card {
        padding: 14px;
    }

    .login-card {
        padding: 28px 22px;
    }

    .credit-cards {
        grid-template-columns: 1fr;
    }
}

/* Sidebar overlay for mobile */
.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 999;
}

.sidebar-overlay.active {
    display: block;
}

/* ======= TABLE TOOLBAR (Search & Filter) ======= */
.table-toolbar {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 22px;
    background: var(--bg-input);
    border-bottom: 1px solid var(--border-light);
    flex-wrap: wrap;
}

.toolbar-search {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--bg-card);
    border: 1.5px solid var(--border);
    border-radius: var(--radius-md);
    padding: 8px 14px;
    flex: 1;
    min-width: 220px;
    transition: var(--transition);
}

.toolbar-search:focus-within {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(0, 77, 64, 0.1);
}

.toolbar-search i {
    color: var(--text-muted);
    font-size: 1.15rem;
}

.toolbar-search input {
    border: none;
    outline: none;
    background: transparent;
    font-size: 0.85rem;
    font-family: inherit;
    color: var(--text-primary);
    width: 100%;
}

.toolbar-search input::placeholder {
    color: var(--text-muted);
}

.toolbar-filters {
    display: flex;
    gap: 8px;
}

.toolbar-select {
    padding: 8px 32px 8px 12px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-md);
    background: var(--bg-card);
    font-size: 0.82rem;
    font-family: inherit;
    color: var(--text-secondary);
    cursor: pointer;
    transition: var(--transition);
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath d='M0 0l5 6 5-6H0z' fill='%2394A3B8'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
}

.toolbar-select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(0, 77, 64, 0.1);
}

.toolbar-count {
    font-size: 0.8rem;
    color: var(--text-muted);
    font-weight: 500;
    white-space: nowrap;
}

.toolbar-info {
    margin-left: auto;
}

/* ======= STATUS PILLS ======= */
.status-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    border-radius: 50px;
    font-size: 0.82rem;
    font-weight: 600;
    white-space: nowrap;
}

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

.status-active {
    background: var(--success-bg);
    color: #16A34A;
}
.status-active .status-dot {
    background: #22C55E;
    box-shadow: 0 0 6px rgba(34, 197, 94, 0.5);
}

.status-disabled {
    background: var(--warning-bg);
    color: #D97706;
}
.status-disabled .status-dot {
    background: #F59E0B;
}

.status-blocked {
    background: var(--danger-bg);
    color: #DC2626;
}
.status-blocked .status-dot {
    background: #EF4444;
}

/* ======= ID BADGE ======= */
.id-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--primary-lighter);
    color: var(--primary);
    font-weight: 700;
    font-size: 0.78rem;
    padding: 3px 10px;
    border-radius: 50px;
    font-family: 'SF Mono', 'Fira Code', monospace;
}

/* ======= MAC ADDRESS CELL ======= */
.mac-cell {
    display: flex;
    align-items: center;
    gap: 8px;
}

.mac-cell i {
    color: var(--primary);
    font-size: 1rem;
}

.mac-address {
    font-weight: 700;
    font-size: 0.85rem;
    color: var(--text-primary);
    letter-spacing: 0.3px;
}

.serial-number {
    font-size: 0.82rem;
    color: var(--text-secondary);
}

/* ======= WATCHING / ONLINE INDICATORS ======= */
.watching-cell {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.online-indicator {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.78rem;
    font-weight: 700;
    color: #16A34A;
}

.pulse-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #22C55E;
    display: inline-block;
    animation: pulseGlow 2s ease-in-out infinite;
    box-shadow: 0 0 6px rgba(34, 197, 94, 0.6);
}

@keyframes pulseGlow {
    0%, 100% { opacity: 1; box-shadow: 0 0 6px rgba(34, 197, 94, 0.6); }
    50% { opacity: 0.5; box-shadow: 0 0 12px rgba(34, 197, 94, 0.3); }
}

.watching-info {
    display: flex;
    flex-direction: column;
    gap: 1px;
}

.watching-channel {
    font-size: 0.78rem;
    color: var(--text-secondary);
    font-weight: 500;
    max-width: 180px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: 4px;
}

.watching-channel i {
    color: var(--info);
    font-size: 0.85rem;
}

.watching-ip {
    font-size: 0.72rem;
    color: var(--text-muted);
    font-family: 'SF Mono', 'Fira Code', monospace;
}

.offline-indicator {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.78rem;
    font-weight: 500;
    color: var(--text-muted);
}

.offline-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--border);
    display: inline-block;
}

/* ======= ADDED BY CELL ======= */
.added-by-cell {
    display: flex;
    align-items: center;
    gap: 8px;
}

.user-mini-avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent), var(--primary));
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 700;
    font-size: 0.72rem;
    flex-shrink: 0;
}

.added-by-cell span {
    font-size: 0.82rem;
    font-weight: 500;
    color: var(--text-secondary);
}

/* ======= DATE CELL ======= */
.date-cell {
    font-size: 0.8rem;
    color: var(--text-muted);
    white-space: nowrap;
}

/* ======= ACTION BUTTONS ======= */
.actions-cell {
    display: flex;
    align-items: center;
    gap: 6px;
}

.action-btn {
    width: 32px;
    height: 32px;
    border-radius: var(--radius-sm);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
    font-size: 1rem;
    border: none;
    cursor: pointer;
}

.action-view {
    background: var(--primary-lighter);
    color: var(--primary);
}

.action-view:hover {
    background: var(--primary);
    color: white;
}

.status-select-wrapper {
    position: relative;
}

.status-select {
    padding: 5px 28px 5px 10px;
    font-size: 0.78rem;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--bg-input);
    font-family: inherit;
    color: var(--text-secondary);
    cursor: pointer;
    transition: var(--transition);
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='8' height='5' viewBox='0 0 8 5'%3E%3Cpath d='M0 0l4 5 4-5H0z' fill='%2394A3B8'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 8px center;
}

.status-select:focus {
    outline: none;
    border-color: var(--primary);
}

.status-select:hover {
    border-color: var(--primary-light);
}

/* ======= RESPONSIVE TABLE TOOLBAR ======= */
@media (max-width: 768px) {
    .table-toolbar {
        flex-direction: column;
        align-items: stretch;
    }
    .toolbar-search {
        min-width: unset;
    }
    .toolbar-filters {
        flex-wrap: wrap;
    }
    .toolbar-info {
        margin-left: 0;
    }
    .watching-channel {
        max-width: 120px;
    }
}

/* ======= RADIO CARD BUTTONS ======= */
.radio-group {
    display: flex;
    gap: 10px;
}

.radio-card {
    flex: 1;
    cursor: pointer;
    position: relative;
}

.radio-card input[type="radio"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.radio-card-content {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    background: var(--bg-input);
    border: 2px solid var(--border);
    border-radius: var(--radius-md);
    transition: var(--transition);
}

.radio-card:hover .radio-card-content {
    border-color: var(--primary-light);
    background: var(--bg-card);
}

.radio-card input[type="radio"]:checked + .radio-card-content {
    border-color: var(--primary);
    background: var(--primary-lighter);
    box-shadow: 0 0 0 3px rgba(0, 77, 64, 0.1);
}

.radio-card-content i {
    font-size: 1.5rem;
    flex-shrink: 0;
}

.radio-card-title {
    display: block;
    font-weight: 700;
    font-size: 0.9rem;
    color: var(--text-primary);
}

.radio-card-count {
    display: block;
    font-size: 0.75rem;
    color: var(--text-muted);
    font-weight: 500;
    margin-top: 1px;
}

@media (max-width: 480px) {
    .radio-group {
        flex-direction: column;
    }
}

/* ======= SCROLLBAR ======= */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

.sidebar::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
}
