/* ===== GoldenPass Backoffice — Base Styles ===== */

*, *::before, *::after {
    box-sizing: border-box;
}

html, body {
    margin: 0;
    padding: 0;
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    background-color: #18181B;
    color: #FAFAFA;
    min-height: 100vh;
}

/* ===== Scrollbar Dark ===== */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: #27272A; }
::-webkit-scrollbar-thumb { background: #52525B; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #71717A; }

/* ===== Login Page ===== */
.login-page {
    position: relative;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}
.login-bg {
    position: absolute;
    inset: 0;
    background: url('/images/bg-login.jpg') center/cover no-repeat;
    filter: brightness(0.3) blur(2px);
    z-index: 0;
}
.login-content {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 420px;
    padding: 1rem;
}
.login-card {
    background: rgba(24, 24, 27, 0.75);
    backdrop-filter: blur(28px);
    -webkit-backdrop-filter: blur(28px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 20px;
    padding: 2.5rem 2rem;
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.6);
}
.login-logo {
    display: block;
    margin: 0 auto 2rem;
    height: 48px;
    object-fit: contain;
}
.login-input {
    width: 100%;
    padding: 0.75rem 1rem;
    margin-bottom: 1rem;
    background: rgba(39, 39, 42, 0.8);
    border: 1px solid rgba(113, 113, 122, 0.3);
    border-radius: 10px;
    color: #FAFAFA;
    font-size: 0.95rem;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
}
.login-input::placeholder { color: rgba(161, 161, 170, 0.6); }
.login-input:focus {
    border-color: #F97316;
    box-shadow: 0 0 0 3px rgba(249, 115, 22, 0.15);
}
.login-input:-webkit-autofill,
.login-input:-webkit-autofill:hover,
.login-input:-webkit-autofill:focus {
    -webkit-box-shadow: 0 0 0 1000px #1a1a2e inset !important;
    -webkit-text-fill-color: rgba(255, 255, 255, 0.92) !important;
    transition: background-color 5000s ease-in-out 0s;
    border-color: rgba(113, 113, 122, 0.3);
}
.login-btn {
    width: 100%;
    padding: 0.75rem;
    background: linear-gradient(135deg, #F97316 0%, #EA580C 100%);
    border: none;
    border-radius: 10px;
    color: white;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: 0 4px 20px rgba(249, 115, 22, 0.35);
}
.login-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 25px rgba(249, 115, 22, 0.45);
}
.login-error {
    background: rgba(239, 68, 68, 0.15);
    border: 1px solid rgba(239, 68, 68, 0.3);
    border-radius: 8px;
    padding: 0.75rem 1rem;
    color: #FCA5A5;
    font-size: 0.875rem;
    margin-bottom: 1rem;
    text-align: center;
}

/* ===== Layout ===== */
.app-layout {
    display: flex;
    min-height: 100vh;
}

/* Sidebar */
.sidebar {
    width: 260px;
    min-height: 100vh;
    background: #0f0f12;
    border-right: 1px solid #27272A;
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    left: 0;
    z-index: 40;
    transition: width 0.3s ease;
}
.sidebar.collapsed { width: 68px; }
.sidebar-header {
    padding: 1.25rem 1rem;
    border-bottom: 1px solid #27272A;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}
.sidebar-logo { height: 32px; object-fit: contain; }
.sidebar.collapsed .sidebar-logo-text { display: none; }
.sidebar-nav { flex: 1; padding: 0.75rem 0.5rem; overflow-y: auto; }
.sidebar-section-title {
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #71717A;
    padding: 0.75rem 0.75rem 0.375rem;
}
.sidebar.collapsed .sidebar-section-title { display: none; }

.nav-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.625rem 0.75rem;
    border-radius: 8px;
    color: #A1A1AA;
    text-decoration: none;
    font-size: 0.875rem;
    font-weight: 500;
    transition: all 0.15s;
    margin-bottom: 2px;
}
.nav-link:hover { background: #27272A; color: #FAFAFA; }
.nav-link.active {
    background: rgba(249, 115, 22, 0.12);
    color: #F97316;
}
.nav-link svg { width: 20px; height: 20px; flex-shrink: 0; }
.sidebar.collapsed .nav-link span { display: none; }

/* Main content */
.main-content {
    flex: 1;
    margin-left: 260px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    transition: margin-left 0.3s ease;
}
.sidebar.collapsed ~ .main-content { margin-left: 68px; }

/* TopBar */
.topbar {
    height: 60px;
    background: #0f0f12;
    border-bottom: 1px solid #27272A;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 1.5rem;
    position: sticky;
    top: 0;
    z-index: 30;
}
.topbar-left {
    display: flex;
    align-items: center;
    gap: 1rem;
}
.topbar-toggle {
    background: none;
    border: none;
    color: #A1A1AA;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 6px;
    transition: all 0.15s;
}
.topbar-toggle:hover { background: #27272A; color: #FAFAFA; }
.topbar-title {
    font-size: 1rem;
    font-weight: 600;
    color: #FAFAFA;
}
.topbar-right {
    display: flex;
    align-items: center;
    gap: 1rem;
}
.topbar-user {
    font-size: 0.875rem;
    color: #A1A1AA;
}
.topbar-logout {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.5rem 0.75rem;
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.2);
    border-radius: 8px;
    color: #FCA5A5;
    font-size: 0.8rem;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.15s;
}
.topbar-logout:hover { background: rgba(239, 68, 68, 0.2); color: #FCA5A5; }

/* Page content */
.page-content { padding: 1.5rem; flex: 1; }

/* ===== Page Header ===== */
.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.5rem;
}
.page-header h1 {
    font-size: 1.5rem;
    font-weight: 700;
    color: #FAFAFA;
    margin: 0;
}
.page-header-actions { display: flex; gap: 0.5rem; }

/* ===== Cards ===== */
.card {
    background: #27272A;
    border: 1px solid #3F3F46;
    border-radius: 12px;
    padding: 1.5rem;
}
.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1rem;
}
.card-title {
    font-size: 1rem;
    font-weight: 600;
    color: #FAFAFA;
    margin: 0;
}

/* ===== KPI Cards ===== */
.kpi-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}
.kpi-card {
    background: #27272A;
    border: 1px solid #3F3F46;
    border-radius: 12px;
    padding: 1.25rem;
    display: flex;
    align-items: center;
    gap: 1rem;
}
.kpi-icon {
    width: 48px;
    height: 48px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.kpi-icon svg { width: 24px; height: 24px; color: white; }
.kpi-info { flex: 1; }
.kpi-label { font-size: 0.8rem; color: #A1A1AA; margin-bottom: 0.25rem; }
.kpi-value { font-size: 1.5rem; font-weight: 700; color: #FAFAFA; }

/* ===== Data Table ===== */
.data-table-wrapper {
    background: #27272A;
    border: 1px solid #3F3F46;
    border-radius: 12px;
    overflow: hidden;
}
.data-table-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid #3F3F46;
}
.data-table-search {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: #18181B;
    border: 1px solid #3F3F46;
    border-radius: 8px;
    padding: 0.5rem 0.75rem;
    min-width: 280px;
}
.data-table-search svg { width: 18px; height: 18px; color: #71717A; flex-shrink: 0; }
.data-table-search input {
    background: transparent;
    border: none;
    outline: none;
    color: #FAFAFA;
    font-size: 0.875rem;
    width: 100%;
}
.data-table-search input::placeholder { color: #71717A; }

table.data-table {
    width: 100%;
    border-collapse: collapse;
}
table.data-table thead th {
    background: #1f1f23;
    padding: 0.75rem 1rem;
    text-align: left;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #A1A1AA;
    border-bottom: 1px solid #3F3F46;
    cursor: pointer;
    user-select: none;
    white-space: nowrap;
}
table.data-table thead th:hover { color: #FAFAFA; }
table.data-table thead th .sort-icon { display: inline-block; margin-left: 0.25rem; }

table.data-table tbody tr {
    border-bottom: 1px solid #3F3F46;
    transition: background 0.1s;
}
table.data-table tbody tr:hover { background: rgba(63, 63, 70, 0.3); }
table.data-table tbody tr:last-child { border-bottom: none; }
table.data-table tbody td {
    padding: 0.75rem 1rem;
    font-size: 0.875rem;
    color: #D4D4D8;
    vertical-align: middle;
}

/* ===== Buttons ===== */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    font-size: 0.875rem;
    font-weight: 500;
    border: none;
    cursor: pointer;
    transition: all 0.15s;
    text-decoration: none;
    white-space: nowrap;
}
.btn svg { width: 18px; height: 18px; }

.btn-primary {
    background: #F97316;
    color: white;
    box-shadow: 0 2px 8px rgba(249, 115, 22, 0.25);
}
.btn-primary:hover { background: #EA580C; }

.btn-secondary {
    background: #3F3F46;
    color: #FAFAFA;
}
.btn-secondary:hover { background: #52525B; }

.btn-success {
    background: #10B981;
    color: white;
}
.btn-success:hover { background: #059669; }

.btn-danger {
    background: rgba(239, 68, 68, 0.15);
    color: #FCA5A5;
    border: 1px solid rgba(239, 68, 68, 0.2);
}
.btn-danger:hover { background: rgba(239, 68, 68, 0.25); }

.btn-ghost {
    background: transparent;
    color: #A1A1AA;
    padding: 0.375rem;
    border-radius: 6px;
}
.btn-ghost:hover { background: #3F3F46; color: #FAFAFA; }

.btn-sm { padding: 0.375rem 0.625rem; font-size: 0.8rem; }
.btn-sm svg { width: 16px; height: 16px; }

/* ===== Badges ===== */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.625rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 500;
}
.badge-success { background: rgba(16, 185, 129, 0.15); color: #34D399; }
.badge-warning { background: rgba(249, 115, 22, 0.15); color: #FB923C; }
.badge-danger { background: rgba(239, 68, 68, 0.15); color: #FCA5A5; }
.badge-info { background: rgba(59, 130, 246, 0.15); color: #93C5FD; }
.badge-neutral { background: rgba(161, 161, 170, 0.15); color: #A1A1AA; }

/* ===== Forms ===== */
.form-group { margin-bottom: 1.25rem; }
.form-label {
    display: block;
    font-size: 0.8rem;
    font-weight: 500;
    color: #A1A1AA;
    margin-bottom: 0.375rem;
}
.form-input {
    width: 100%;
    padding: 0.625rem 0.875rem;
    background: #18181B;
    border: 1px solid #3F3F46;
    border-radius: 8px;
    color: #FAFAFA;
    font-size: 0.875rem;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
}
.form-input::placeholder { color: #71717A; }
.form-input:focus {
    border-color: #F97316;
    box-shadow: 0 0 0 3px rgba(249, 115, 22, 0.1);
}
.form-input:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}
select.form-input {
    appearance: none;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3e%3c/svg%3e");
    background-position: right 0.5rem center;
    background-repeat: no-repeat;
    background-size: 1.5em 1.5em;
    padding-right: 2.5rem;
}
textarea.form-input { min-height: 80px; resize: vertical; }
.form-check {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.form-check input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: #F97316;
    cursor: pointer;
}
.form-error {
    color: #FCA5A5;
    font-size: 0.8rem;
    margin-top: 0.25rem;
}
.form-actions {
    display: flex;
    gap: 0.75rem;
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid #3F3F46;
}

/* ===== Tabs ===== */
.tabs {
    display: flex;
    gap: 0;
    border-bottom: 1px solid #3F3F46;
    margin-bottom: 1.5rem;
}
.tab {
    padding: 0.75rem 1.25rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: #A1A1AA;
    border-bottom: 2px solid transparent;
    cursor: pointer;
    transition: all 0.15s;
    background: none;
    border-top: none;
    border-left: none;
    border-right: none;
}
.tab:hover { color: #FAFAFA; }
.tab.active {
    color: #F97316;
    border-bottom-color: #F97316;
}

/* ===== Modal ===== */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 50;
    padding: 1rem;
}
.modal-card {
    background: #27272A;
    border: 1px solid #3F3F46;
    border-radius: 16px;
    padding: 1.5rem;
    max-width: 500px;
    width: 100%;
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.5);
}
.modal-title {
    font-size: 1.125rem;
    font-weight: 600;
    color: #FAFAFA;
    margin-bottom: 0.75rem;
}
.modal-body { color: #A1A1AA; font-size: 0.9rem; margin-bottom: 1.5rem; }
.modal-actions { display: flex; gap: 0.75rem; justify-content: flex-end; }

/* ===== Pagination ===== */
.pagination {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.25rem;
    border-top: 1px solid #3F3F46;
}
.pagination-info { font-size: 0.8rem; color: #71717A; }
.pagination-controls { display: flex; gap: 0.25rem; }
.pagination-btn {
    padding: 0.375rem 0.75rem;
    background: #3F3F46;
    border: none;
    border-radius: 6px;
    color: #A1A1AA;
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.15s;
}
.pagination-btn:hover:not(:disabled) { background: #52525B; color: #FAFAFA; }
.pagination-btn:disabled { opacity: 0.4; cursor: not-allowed; }
.pagination-btn.active { background: #F97316; color: white; }

/* ===== Toast ===== */
.toast-container {
    position: fixed;
    top: 1rem;
    right: 1rem;
    z-index: 60;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}
.toast {
    padding: 0.875rem 1.25rem;
    border-radius: 10px;
    font-size: 0.875rem;
    font-weight: 500;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
    animation: toast-in 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.toast svg { width: 20px; height: 20px; flex-shrink: 0; }
.toast-success { background: #065F46; color: #A7F3D0; border: 1px solid #10B981; }
.toast-error { background: #7F1D1D; color: #FCA5A5; border: 1px solid #EF4444; }
.toast-info { background: #1E3A5F; color: #93C5FD; border: 1px solid #3B82F6; }
@keyframes toast-in {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

/* ===== Loading ===== */
.loading-bar {
    height: 3px;
    background: linear-gradient(90deg, transparent 0%, #F97316 50%, transparent 100%);
    animation: loading-slide 1.5s infinite;
    border-radius: 2px;
    margin-bottom: 1rem;
}
@keyframes loading-slide {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

.spinner {
    width: 32px;
    height: 32px;
    border: 3px solid #3F3F46;
    border-top-color: #F97316;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ===== Empty State ===== */
.empty-state {
    text-align: center;
    padding: 3rem 1.5rem;
    color: #71717A;
}
.empty-state svg { width: 48px; height: 48px; margin: 0 auto 1rem; opacity: 0.5; }
.empty-state p { font-size: 0.9rem; }

/* ===== Responsive ===== */
@media (max-width: 768px) {
    .sidebar { width: 0; overflow: hidden; }
    .sidebar.open { width: 260px; }
    .main-content { margin-left: 0 !important; }
    .data-table-toolbar { flex-direction: column; gap: 0.75rem; }
    .data-table-search { min-width: 100%; }
}
