:root {
    --bg-main: #0B0914;
    --bg-card: #141220;
    --bg-card-hover: #1A172A;
    --border-color: #27223D;
    --border-focus: #8B5CF6;
    
    --primary: #8B5CF6;
    --primary-hover: #7C3AED;
    --primary-light: rgba(139, 92, 246, 0.15);
    
    --success: #10B981;
    --success-bg: rgba(16, 185, 129, 0.12);
    --warning: #F59E0B;
    --warning-bg: rgba(245, 158, 11, 0.12);
    --danger: #EF4444;
    --danger-bg: rgba(239, 68, 68, 0.12);
    --info: #3B82F6;
    --info-bg: rgba(59, 130, 246, 0.12);

    --text-main: #F3F4F6;
    --text-muted: #9CA3AF;
    --text-sub: #6B7280;

    --font-sans: 'Outfit', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --font-mono: 'JetBrains Mono', Consolas, monospace;
    --radius: 10px;
    --shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.5), 0 8px 10px -6px rgba(0, 0, 0, 0.5);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    background-color: var(--bg-main);
    color: var(--text-main);
    font-family: var(--font-sans);
    line-height: 1.5;
    min-height: 100vh;
    overflow-x: hidden;
}

.hidden {
    display: none !important;
}

/* ----------------------------------------------------
   LOGIN OVERLAY
---------------------------------------------------- */
.login-wrapper {
    position: fixed;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: radial-gradient(circle at top center, rgba(139, 92, 246, 0.12), transparent 70%), var(--bg-main);
    z-index: 999;
}

.login-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 40px;
    width: 100%;
    max-width: 420px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.7);
    text-align: center;
}

.brand-header {
    margin-bottom: 28px;
}

.logo-icon {
    width: 54px;
    height: 54px;
    background: linear-gradient(135deg, #A855F7, #6366F1);
    color: white;
    font-size: 26px;
    font-weight: 800;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 16px;
    box-shadow: 0 8px 20px rgba(139, 92, 246, 0.4);
}

.brand-header h1 {
    font-size: 22px;
    font-weight: 700;
    letter-spacing: -0.5px;
    margin-bottom: 4px;
}

.brand-header p {
    font-size: 13px;
    color: var(--text-muted);
}

.login-footer {
    margin-top: 24px;
    font-size: 11px;
    color: var(--text-sub);
}

/* ----------------------------------------------------
   INPUTS & BUTTONS
---------------------------------------------------- */
.input-group {
    text-align: left;
    margin-bottom: 18px;
}

.input-group label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
    margin-bottom: 6px;
}

input, select, textarea {
    width: 100%;
    background: #0E0C18;
    border: 1px solid var(--border-color);
    color: var(--text-main);
    border-radius: 8px;
    padding: 10px 14px;
    font-family: inherit;
    font-size: 14px;
    transition: all 0.2s ease;
}

input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: var(--border-focus);
    box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.2);
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 9px 16px;
    border-radius: 8px;
    font-family: inherit;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    border: 1px solid transparent;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.btn-primary {
    background: linear-gradient(135deg, #9333EA, #7C3AED);
    color: white;
    box-shadow: 0 4px 12px rgba(124, 58, 237, 0.3);
}

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

.btn-secondary {
    background: #181528;
    border-color: var(--border-color);
    color: var(--text-main);
}

.btn-secondary:hover {
    background: #231F3A;
    border-color: #3B345A;
}

.btn-warning {
    background: #D97706;
    color: white;
}

.btn-warning:hover {
    background: #B45309;
}

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

.btn-outline-danger {
    background: transparent;
    border-color: rgba(239, 68, 68, 0.3);
    color: #F87171;
}

.btn-outline-danger:hover {
    background: var(--danger-bg);
    border-color: var(--danger);
}

.btn-block {
    width: 100%;
    padding: 12px;
}

.btn-sm {
    padding: 5px 10px;
    font-size: 12px;
}

/* ----------------------------------------------------
   TOPBAR
---------------------------------------------------- */
.top-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 32px;
    background: var(--bg-card);
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 100;
}

.nav-brand {
    display: flex;
    align-items: center;
    gap: 12px;
}

.brand-badge {
    width: 38px;
    height: 38px;
    background: linear-gradient(135deg, #A855F7, #6366F1);
    color: white;
    font-weight: 800;
    font-size: 18px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 10px rgba(139, 92, 246, 0.3);
}

.brand-text h2 {
    font-size: 16px;
    font-weight: 700;
    line-height: 1.2;
}

.server-status {
    font-size: 11px;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 6px;
}

.pulse-dot {
    width: 7px;
    height: 7px;
    background: var(--success);
    border-radius: 50%;
    box-shadow: 0 0 8px var(--success);
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { transform: scale(0.95); opacity: 0.8; }
    50% { transform: scale(1.2); opacity: 1; }
    100% { transform: scale(0.95); opacity: 0.8; }
}

.nav-search {
    position: relative;
    width: 380px;
}

.nav-search svg {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-sub);
}

.nav-search input {
    padding-left: 38px;
    padding-right: 30px;
    height: 38px;
    border-radius: 20px;
    background: #0B0914;
}

.clear-btn {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--text-sub);
    font-size: 16px;
    cursor: pointer;
}

.nav-actions {
    display: flex;
    align-items: center;
    gap: 14px;
}

.admin-profile {
    display: flex;
    align-items: center;
    gap: 10px;
    background: #0E0C18;
    padding: 4px 8px 4px 14px;
    border-radius: 20px;
    border: 1px solid var(--border-color);
}

.admin-name {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-main);
}

/* ----------------------------------------------------
   STATS SECTION
---------------------------------------------------- */
.main-content {
    padding: 28px 32px;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
    gap: 18px;
    margin-bottom: 28px;
}

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

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

.stat-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.stat-icon.purple { background: var(--primary-light); color: var(--primary); }
.stat-icon.green { background: var(--success-bg); color: var(--success); }
.stat-icon.blue { background: var(--info-bg); color: var(--info); }
.stat-icon.amber { background: var(--warning-bg); color: var(--warning); }
.stat-icon.red { background: var(--danger-bg); color: var(--danger); }

.stat-label {
    font-size: 12px;
    font-weight: 500;
    color: var(--text-muted);
}

.stat-info h3 {
    font-size: 24px;
    font-weight: 700;
    letter-spacing: -0.5px;
    line-height: 1.1;
    margin-top: 2px;
}

/* ----------------------------------------------------
   CONTROLS & TABLE
---------------------------------------------------- */
.table-controls {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 14px;
    margin-bottom: 18px;
}

.filter-pills {
    display: flex;
    align-items: center;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    padding: 4px;
    border-radius: 10px;
    gap: 4px;
}

.pill {
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-family: inherit;
    font-size: 12px;
    font-weight: 600;
    padding: 6px 14px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.pill:hover {
    color: var(--text-main);
}

.pill.active {
    background: var(--primary);
    color: white;
}

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

.table-container {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 14px;
    overflow: hidden;
    box-shadow: var(--shadow);
}

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

.data-table th {
    background: #110E1D;
    color: var(--text-muted);
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 14px 18px;
    border-bottom: 1px solid var(--border-color);
}

.data-table td {
    padding: 14px 18px;
    border-bottom: 1px solid #1C192E;
    vertical-align: middle;
}

.data-table tr:hover td {
    background: #18152A;
}

.text-right {
    text-align: right;
}

/* ----------------------------------------------------
   TABLE ITEMS & BADGES
---------------------------------------------------- */
.key-cell {
    display: flex;
    align-items: center;
    gap: 8px;
}

.mono-key {
    font-family: var(--font-mono);
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0.5px;
    color: #C084FC;
}

.copy-key-btn {
    background: none;
    border: none;
    color: var(--text-sub);
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    display: flex;
    align-items: center;
    transition: all 0.2s ease;
}

.copy-key-btn:hover {
    color: var(--text-main);
    background: #231E38;
}

.customer-cell {
    display: flex;
    flex-direction: column;
}

.customer-name {
    font-weight: 600;
    color: var(--text-main);
}

.discord-tag {
    font-size: 11.5px;
    color: #818CF8;
}

.hwid-badge {
    font-family: var(--font-mono);
    font-size: 11px;
    color: var(--text-muted);
    background: #0E0C18;
    padding: 3px 8px;
    border-radius: 4px;
    border: 1px solid #231E38;
    display: inline-block;
}

.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.4px;
    text-transform: uppercase;
}

.status-badge.ACTIVE { background: var(--success-bg); color: var(--success); border: 1px solid rgba(16, 185, 129, 0.3); }
.status-badge.UNREDEEMED { background: var(--info-bg); color: var(--info); border: 1px solid rgba(59, 130, 246, 0.3); }
.status-badge.SUSPENDED { background: var(--warning-bg); color: var(--warning); border: 1px solid rgba(245, 158, 11, 0.3); }
.status-badge.REVOKED { background: var(--danger-bg); color: var(--danger); border: 1px solid rgba(239, 68, 68, 0.3); }
.status-badge.EXPIRED { background: rgba(156, 163, 175, 0.12); color: #9CA3AF; border: 1px solid rgba(156, 163, 175, 0.3); }

.action-btn-group {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 6px;
}

.action-icon-btn {
    width: 30px;
    height: 30px;
    border-radius: 6px;
    background: #181528;
    border: 1px solid var(--border-color);
    color: var(--text-muted);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.action-icon-btn:hover {
    background: #25203D;
    color: var(--text-main);
    border-color: #3E3760;
}

.action-icon-btn.btn-revoke:hover {
    background: var(--danger-bg);
    color: var(--danger);
    border-color: var(--danger);
}

.action-icon-btn.btn-reset:hover {
    background: var(--warning-bg);
    color: var(--warning);
    border-color: var(--warning);
}

/* ----------------------------------------------------
   MODALS
---------------------------------------------------- */
.modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 20px;
}

.modal-content {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    width: 100%;
    max-width: 540px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.8);
    overflow: hidden;
    animation: modalScale 0.2s ease-out;
}

.modal-sm { max-width: 420px; }
.modal-lg { max-width: 780px; }

@keyframes modalScale {
    from { transform: scale(0.95); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 24px;
    background: #100D1B;
    border-bottom: 1px solid var(--border-color);
}

.modal-header h3 {
    font-size: 16px;
    font-weight: 700;
}

.modal-close {
    background: none;
    border: none;
    color: var(--text-sub);
    font-size: 20px;
    cursor: pointer;
}

.modal-close:hover {
    color: var(--text-main);
}

.modal-body {
    padding: 20px 24px;
}

form {
    padding: 20px 24px;
}

.modal-footer {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    padding: 16px 24px;
    background: #100D1B;
    border-top: 1px solid var(--border-color);
    margin-top: 20px;
}

.mono-badge {
    font-family: var(--font-mono);
    color: var(--primary);
    background: #0E0C18;
    padding: 2px 6px;
    border-radius: 4px;
    border: 1px solid #231E38;
}

.extend-presets {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
    margin-top: 10px;
}

.logs-container {
    max-height: 400px;
    overflow-y: auto;
}

/* ----------------------------------------------------
   ALERTS & TOASTS
---------------------------------------------------- */
.alert-box {
    padding: 10px 14px;
    border-radius: 8px;
    font-size: 13px;
    margin-bottom: 14px;
    text-align: left;
}

.alert-box.error {
    background: var(--danger-bg);
    border: 1px solid rgba(239, 68, 68, 0.4);
    color: #F87171;
}

.alert-box.warning {
    background: var(--warning-bg);
    border: 1px solid rgba(245, 158, 11, 0.4);
    color: #FBBF24;
}

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

.toast {
    background: #1E1A33;
    color: white;
    padding: 12px 18px;
    border-radius: 10px;
    border: 1px solid #382F58;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5);
    font-size: 13.5px;
    display: flex;
    align-items: center;
    gap: 10px;
    animation: toastSlide 0.3s ease-out;
}

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

.spinner {
    width: 24px;
    height: 24px;
    border: 3px solid rgba(139, 92, 246, 0.2);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin: 0 auto 10px;
}

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

.loading-state {
    text-align: center;
    padding: 40px !important;
    color: var(--text-muted);
}

/* Customer History Styles */
.customer-cell.clickable {
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    flex-direction: column;
}

.customer-cell.clickable:hover .customer-name {
    color: var(--primary);
    text-decoration: underline;
}

.customer-history-card {
    background: rgba(20, 16, 36, 0.75);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 14px 16px;
    transition: all 0.2s ease;
}

.customer-history-card:hover {
    border-color: rgba(168, 85, 247, 0.5);
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.3);
}

.history-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
    padding-bottom: 8px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.history-card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 8px 16px;
    font-size: 12.5px;
}

.history-grid-item {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.history-grid-label {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
}

.history-grid-value {
    color: var(--text-main);
    font-weight: 500;
}

/* ----------------------------------------------------
   HWID RESETS & LIGHTBOX STYLES
---------------------------------------------------- */
.modal-content.modal-xl {
    max-width: 1050px;
    width: 96%;
}

.badge-counter {
    background: #ef4444;
    color: white;
    font-size: 11px;
    font-weight: 700;
    padding: 2px 7px;
    border-radius: 10px;
    margin-left: 6px;
    display: inline-block;
}

.table-thumb {
    width: 64px;
    height: 40px;
    object-fit: cover;
    border-radius: 6px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    background: #000;
}

.table-thumb:hover {
    transform: scale(1.15);
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.7);
    border-color: var(--primary);
}

.reset-status-badge {
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    display: inline-block;
}

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

.reset-status-badge.approved {
    background: rgba(34, 197, 94, 0.15);
    color: #4ade80;
    border: 1px solid rgba(34, 197, 94, 0.3);
}

.reset-status-badge.rejected {
    background: rgba(239, 68, 68, 0.15);
    color: #f87171;
    border: 1px solid rgba(239, 68, 68, 0.3);
}

.lightbox-content {
    position: relative;
    max-width: 90vw;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.lightbox-content img {
    max-width: 100%;
    max-height: 82vh;
    border-radius: 8px;
    box-shadow: 0 12px 48px rgba(0, 0, 0, 0.85);
    border: 1px solid rgba(255, 255, 255, 0.15);
}
