/* GAMITEC Dashboard Styles */
:root {
    --primary: #00FF88;
    --primary-dark: #00cc6d;
    --secondary: #00D4FF;
    --bg-dark: #0A0E27;
    --surface-dark: #151a30;
    --surface-light: #1e2542;
    --text-main: #f3f4f6;
    --text-muted: #9ca3af;
    --border: rgba(255, 255, 255, 0.1);
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
}

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

body {
    font-family: 'Inter', system-ui, sans-serif;
    /* Background with new metallic logo */
    background: linear-gradient(rgba(10, 14, 39, 0.92), rgba(10, 14, 39, 0.95)), url('main-bg.jpg');
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    color: var(--text-main);
    height: 100vh;
    overflow: hidden;
}

/* AUTH SCREEN */
.auth-container {
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: radial-gradient(circle at 50% 0%, rgba(0, 255, 136, 0.1) 0%, transparent 60%);
    position: relative;
    z-index: 100;
}

.auth-card {
    background: var(--surface-dark);
    padding: 2.5rem;
    border-radius: 1.5rem;
    width: 100%;
    max-width: 420px;
    border: 1px solid var(--border);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(10px);
}

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

.auth-logo {
    font-size: 2rem;
    font-weight: 800;
    color: var(--primary);
    margin-bottom: 0.5rem;
    display: inline-block;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-label {
    display: block;
    margin-bottom: 0.5rem;
    color: var(--text-muted);
    font-size: 0.9rem;
}

.form-input {
    width: 100%;
    padding: 0.875rem 1rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border);
    border-radius: 0.5rem;
    color: white;
    font-size: 1rem;
    transition: all 0.3s ease;
}

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

.btn-auth {
    width: 100%;
    padding: 1rem;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: var(--bg-dark);
    font-weight: 700;
    border: none;
    border-radius: 0.5rem;
    cursor: pointer;
    font-size: 1rem;
    transition: transform 0.2s;
}

.btn-auth:hover {
    transform: translateY(-2px);
}

/* DASHBOARD LAYOUT */
.app-container {
    display: flex;
    height: 100vh;
}

/* Sidebar */
.sidebar {
    width: 260px;
    background: var(--surface-dark);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    padding: 1.5rem;
    transition: transform 0.3s ease;
}

.sidebar-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 2.5rem;
    padding: 0 0.5rem;
}

.brand-icon {
    width: 36px;
    height: 36px;
    background: rgba(0, 255, 136, 0.1);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary);
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 0.875rem;
    padding: 0.875rem 1rem;
    color: var(--text-muted);
    text-decoration: none;
    border-radius: 0.75rem;
    margin-bottom: 0.5rem;
    transition: all 0.2s ease;
    cursor: pointer;
}

.nav-item:hover,
.nav-item.active {
    background: rgba(0, 255, 136, 0.1);
    color: var(--primary);
}

.nav-item.active {
    font-weight: 600;
}

.sidebar-footer {
    margin-top: auto;
    border-top: 1px solid var(--border);
    padding-top: 1.5rem;
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 0.75rem;
}

.user-avatar {
    width: 36px;
    height: 36px;
    background: linear-gradient(135deg, #6366f1 0%, #a855f7 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.9rem;
    overflow: hidden;
    /* Ensure image stays in circle */
    flex-shrink: 0;
}

.user-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Main Content */
.main-content {
    flex: 1;
    overflow-y: auto;
    padding: 2rem;
    background: var(--bg-dark);
}

.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;

    /* New Banner Styles */
    background: linear-gradient(90deg, rgba(10, 14, 39, 0.9) 0%, rgba(10, 14, 39, 0.6) 100%),
        url('welcome-bg.png');
    background-size: cover;
    background-position: center;
    padding: 2.5rem;
    border-radius: 1.5rem;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    position: relative;
    overflow: hidden;
}

.page-title {
    position: relative;
    z-index: 2;
}

.page-title h1 {
    font-size: 2rem;
    font-weight: 800;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
}

.page-title p {
    color: #d1d5db;
    margin-top: 0.5rem;
    font-size: 1.1rem;
}

/* Stats Cards */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: rgba(21, 26, 48, 0.6);
    /* Semi-transparent */
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    padding: 1.5rem;
    border-radius: 1rem;
    border: 1px solid rgba(255, 255, 255, 0.08);
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

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

.stat-value {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text-main);
}

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

/* Orders Table */
.content-card {
    background: rgba(21, 26, 48, 0.6);
    /* Semi-transparent */
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-radius: 1rem;
    border: 1px solid rgba(255, 255, 255, 0.08);
    overflow: hidden;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

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

.table-responsive {
    overflow-x: auto;
}

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

th,
td {
    padding: 1rem 1.5rem;
    text-align: left;
}

th {
    background: rgba(0, 0, 0, 0.2);
    color: var(--text-muted);
    font-weight: 500;
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

td {
    border-bottom: 1px solid var(--border);
    color: var(--text-main);
}

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

/* Status Badges */
.status-badge {
    padding: 0.25rem 0.75rem;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
}

.status-pending {
    background: rgba(245, 158, 11, 0.15);
    color: #f59e0b;
}

.status-active {
    background: rgba(59, 130, 246, 0.15);
    color: #3b82f6;
}

.status-completed {
    background: rgba(16, 185, 129, 0.15);
    color: #10b981;
}

/* Utilities */
.hidden {
    display: none !important;
}

.text-primary {
    color: var(--primary);
}

/* Mobile Header */
.mobile-header {
    display: none;
    align-items: center;
    justify-content: space-between;
    padding: 1rem;
    background: var(--surface-dark);
    border-bottom: 1px solid var(--border);
    margin: -2rem -2rem 2rem -2rem;
    position: sticky;
    top: -2rem;
    z-index: 10;
}

.mobile-header-title {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 800;
    font-size: 1.1rem;
}

.menu-toggle,
.mobile-logout {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border);
    color: var(--text-main);
    padding: 0.75rem;
    border-radius: 0.5rem;
    cursor: pointer;
    font-size: 1.25rem;
    transition: all 0.2s ease;
}

.menu-toggle:hover,
.mobile-logout:hover {
    background: rgba(0, 255, 136, 0.1);
    color: var(--primary);
}

.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    z-index: 40;
    backdrop-filter: blur(4px);
}

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

/* Mobile */
@media (max-width: 768px) {
    .mobile-header {
        display: flex;
    }

    .sidebar {
        position: fixed;
        left: -100%;
        bottom: 0;
        top: 0;
        z-index: 50;
        box-shadow: 2px 0 20px rgba(0, 0, 0, 0.5);
    }

    .sidebar.active {
        left: 0;
    }

    .main-content {
        padding: 2rem 1rem;
    }

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

    .page-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }

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

    /* TABLE TO CARDS TRANSFORMATION */
    .table-responsive table,
    .table-responsive thead,
    .table-responsive tbody,
    .table-responsive th,
    .table-responsive td,
    .table-responsive tr {
        display: block;
    }

    .table-responsive thead tr {
        position: absolute;
        top: -9999px;
        left: -9999px;
    }

    .table-responsive tr {
        background: rgba(255, 255, 255, 0.02);
        border: 1px solid var(--border);
        border-radius: 1rem;
        margin-bottom: 1rem;
        padding: 1rem;
    }

    .table-responsive td {
        border: none;
        position: relative;
        padding-left: 50% !important;
        text-align: right !important;
        margin-bottom: 0.5rem;
    }

    .table-responsive td:before {
        content: attr(data-label);
        position: absolute;
        left: 1rem;
        width: 45%;
        padding-right: 10px;
        white-space: nowrap;
        text-align: left;
        font-weight: bold;
        color: var(--text-muted);
        text-transform: uppercase;
        font-size: 0.7rem;
    }

    .table-responsive td:last-child {
        margin-bottom: 0;
        padding-top: 1rem;
        border-top: 1px solid var(--border);
        display: flex;
        justify-content: flex-end;
        gap: 0.5rem;
    }
}


/* NOTIFICATION SYSTEM */
.notification-container {
    position: fixed;
    top: 2rem;
    right: 2rem;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    pointer-events: none;
}

.toast {
    background: var(--surface-dark);
    border-left: 4px solid var(--primary);
    color: white;
    padding: 1rem 1.5rem;
    border-radius: 0.75rem;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    display: flex;
    align-items: center;
    gap: 1rem;
    min-width: 300px;
    pointer-events: auto;
    animation: toastSlideIn 0.3s ease-out forwards;
    border: 1px solid var(--border);
}

.toast.success {
    border-left-color: #10b981;
}

.toast.error {
    border-left-color: #ef4444;
}

.toast.info {
    border-left-color: var(--secondary);
}

.toast i {
    font-size: 1.25rem;
}

.toast.success i {
    color: #10b981;
}

.toast.error i {
    color: #ef4444;
}

.toast.info i {
    color: var(--secondary);
}

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

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

@keyframes toastSlideOut {
    from {
        opacity: 1;
        transform: translateX(0);
    }

    to {
        opacity: 0;
        transform: translateX(100%);
    }
}

.toast.removing {
    animation: toastSlideOut 0.3s ease-in forwards;
}

/* BUDGET ACCEPTANCE STYLES */
.budget-status {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.85rem;
    padding: 0.25rem 0.75rem;
    border-radius: 2rem;
    margin-top: 0.5rem;
}

.budget-match {
    background: rgba(16, 185, 129, 0.15);
    color: #10b981;
    border: 1px solid rgba(16, 185, 129, 0.3);
    box-shadow: 0 0 15px rgba(16, 185, 129, 0.2);
}

.budget-over {
    background: rgba(245, 158, 11, 0.15);
    color: #f59e0b;
    border: 1px solid rgba(245, 158, 11, 0.3);
    box-shadow: 0 0 15px rgba(245, 158, 11, 0.1);
}


.budget-pending {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-muted);
    border: 1px solid var(--border);
}

.savings-badge {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.2) 0%, rgba(5, 150, 105, 0.2) 100%);
    color: #10b981;
    border: 1px solid rgba(16, 185, 129, 0.4);
    padding: 0.5rem 1rem;
    border-radius: 0.75rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-top: 1rem;
    font-weight: 600;
    animation: savingsPulse 2s infinite;
}

@keyframes savingsPulse {
    0% {
        box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.4);
    }

    70% {
        box-shadow: 0 0 0 10px rgba(16, 185, 129, 0);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(16, 185, 129, 0);
    }
}

.chart-wrapper {
    height: 40px !important;
    background: rgba(0, 0, 0, 0.2) !important;
    border-radius: 20px !important;
    padding: 4px !important;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.3);
}

.chart-segment {
    height: 100%;
    border-radius: 16px;
    margin: 0 2px;
    transition: width 1s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.75rem;
    color: white;
    position: relative;
    overflow: hidden;
}

.chart-segment::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(rgba(255, 255, 255, 0.1), transparent);
}

.segment-paid {
    background: linear-gradient(90deg, #00f2fe 0%, #4facfe 100%);
    box-shadow: 0 0 15px rgba(79, 172, 254, 0.3);
}

.segment-expenses {
    background: linear-gradient(90deg, #667eea 0%, #764ba2 100%);
    box-shadow: 0 0 15px rgba(118, 75, 162, 0.3);
}

.segment-unpaid {
    background: linear-gradient(90deg, #f093fb 0%, #f5576c 100%);
    box-shadow: 0 0 15px rgba(245, 87, 108, 0.3);
}

.report-template {
    display: none;
    padding: 40px;
    background: white;
    color: #1a1a1a;
    font-family: 'Inter', sans-serif;
}


/* PROGRESS BAR */
.progress-container {
    margin: 1.5rem 0;
}

.progress-track {
    height: 8px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 4px;
    position: relative;
    overflow: hidden;
}

.progress-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--primary), var(--secondary));
    box-shadow: 0 0 10px var(--primary);
    transition: width 0.5s ease;
}

/* TIMELINE */
.timeline {
    border-left: 2px solid var(--border);
    margin-left: 0.5rem;
    padding-left: 1.5rem;
}

.timeline-item {
    position: relative;
    padding-bottom: 1.5rem;
}

.timeline-item::before {
    content: '';
    position: absolute;
    left: -1.95rem;
    top: 0;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--surface-light);
    border: 2px solid var(--primary);
}

.timeline-date {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.timeline-desc {
    font-size: 0.9rem;
    margin-top: 0.25rem;
}

/* SEARCH & FILTERS */
.filter-bar {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.search-input {
    flex: 1;
    position: relative;
}

.search-input i {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
}

.search-input input {
    width: 100%;
    padding: 0.75rem 1rem 0.75rem 2.5rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border);
    border-radius: 0.75rem;
    color: white;
}

/* PRIORITY TAGS */
.priority-tag {
    font-size: 0.7rem;
    padding: 2px 6px;
    border-radius: 4px;
    font-weight: 700;
    text-transform: uppercase;
}

.priority-urgent {
    background: rgba(239, 68, 68, 0.15);
    color: #ef4444;
}

.priority-high {
    background: rgba(245, 158, 11, 0.15);
    color: #f59e0b;
}

.priority-normal {
    background: rgba(16, 185, 129, 0.15);
    color: #10b981;
}

/* MODAL STYLES */
.modal {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 200;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(8px);
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: var(--surface-dark);
    border: 1px solid var(--border);
    border-radius: 1.5rem;
    width: 100%;
    max-width: 650px;
    max-height: 90vh;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    animation: modalAppear 0.3s ease-out;
}

@keyframes modalAppear {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

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

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

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

.modal-body {
    padding: 1.5rem;
}

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

.detail-item {
    margin-bottom: 1.25rem;
}

.detail-label {
    font-size: 0.8rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.25rem;
}

.detail-value {
    font-size: 1.1rem;
    color: var(--text-main);
    font-weight: 500;
}