/* ===== ROOT VARIABLES ===== */
:root {
    --primary-color: #2563eb;
    --primary-dark: #1d4ed8;
    --secondary-color: #10b981;
    --danger-color: #ef4444;
    --warning-color: #f59e0b;
    --success-color: #10b981;
    --info-color: #3b82f6;

    --bg-primary: #0f172a;
    --bg-secondary: #1e293b;
    --bg-tertiary: #334155;
    --bg-card: #1e293b;

    --text-primary: #f1f5f9;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;

    --border-color: #334155;
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.4);

    --sidebar-width: 260px;
    --header-height: 70px;

    --font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

/* ===== RESET & BASE ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-family);
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    overflow-x: hidden;
}

/* ===== LOGIN PAGE ===== */
.login-container {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 20px;
}

.login-card {
    background: var(--bg-card);
    border-radius: 16px;
    padding: 40px;
    width: 100%;
    max-width: 420px;
    box-shadow: var(--shadow-lg);
    animation: slideUp 0.5s ease;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.login-header {
    text-align: center;
    margin-bottom: 32px;
}

.logo-icon {
    font-size: 48px;
    color: var(--primary-color);
    margin-bottom: 16px;
}

.login-header h1 {
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 8px;
}

.login-header p {
    color: var(--text-secondary);
    font-size: 14px;
}

.login-form .form-group {
    margin-bottom: 20px;
}

.login-form label {
    display: block;
    margin-bottom: 8px;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-secondary);
}

.login-form label i {
    margin-right: 6px;
}

.login-form input {
    width: 100%;
    padding: 12px 16px;
    background: var(--bg-tertiary);
    border: 2px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-primary);
    font-size: 14px;
    transition: all 0.3s;
}

.login-form input:focus {
    outline: none;
    border-color: var(--primary-color);
    background: var(--bg-secondary);
}

.error-message {
    background: rgba(239, 68, 68, 0.1);
    border-left: 4px solid var(--danger-color);
    color: var(--danger-color);
    padding: 12px;
    border-radius: 4px;
    margin-bottom: 20px;
    font-size: 14px;
}

/* ===== BUTTONS ===== */
.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.btn-primary {
    background: var(--primary-color);
    color: white;
}

.btn-primary:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}

.btn-block {
    width: 100%;
    justify-content: center;
}

.btn-success {
    background: var(--success-color);
    color: white;
}

.btn-danger {
    background: var(--danger-color);
    color: white;
}

.btn-warning {
    background: var(--warning-color);
    color: white;
}

.btn-icon {
    background: var(--bg-tertiary);
    color: var(--text-primary);
    padding: 10px;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-icon:hover {
    background: var(--bg-secondary);
}

/* ===== DASHBOARD LAYOUT ===== */
.dashboard {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: var(--sidebar-width);
    background: var(--bg-secondary);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    position: fixed;
    height: 100vh;
    left: 0;
    top: 0;
}

.sidebar-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 24px;
    border-bottom: 1px solid var(--border-color);
    font-size: 20px;
    font-weight: 700;
}

.sidebar-header i {
    color: var(--primary-color);
    font-size: 28px;
}

.sidebar-nav {
    flex: 1;
    padding: 20px 0;
    overflow-y: auto;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 24px;
    color: var(--text-secondary);
    text-decoration: none;
    transition: all 0.3s;
    margin: 4px 12px;
    border-radius: 8px;
}

.nav-item:hover {
    background: rgba(37, 99, 235, 0.1);
    color: var(--primary-color);
}

.nav-item.active {
    background: rgba(37, 99, 235, 0.15);
    color: var(--primary-color);
    font-weight: 600;
}

.nav-item i {
    font-size: 18px;
    width: 20px;
}

.sidebar-footer {
    border-top: 1px solid var(--border-color);
    padding: 20px;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
    padding: 10px;
    background: var(--bg-tertiary);
    border-radius: 8px;
}

.user-info i {
    font-size: 24px;
    color: var(--primary-color);
}

.btn-logout {
    width: 100%;
    padding: 10px;
    background: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn-logout:hover {
    background: var(--danger-color);
    color: white;
    border-color: var(--danger-color);
}

/* ===== MAIN CONTENT ===== */
.main-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    min-height: 100vh;
}

.content-header {
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
    padding: 20px 32px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 10;
}

.content-header h1 {
    font-size: 24px;
    font-weight: 700;
}

.header-actions {
    display: flex;
    gap: 12px;
}

.content-area {
    padding: 32px;
}

/* ===== STATS CARDS ===== */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 24px;
    margin-bottom: 32px;
}

.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 24px;
    transition: all 0.3s;
}

.stat-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.stat-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 12px;
}

.stat-title {
    font-size: 14px;
    color: var(--text-secondary);
    font-weight: 500;
}

.stat-icon {
    background: rgba(37, 99, 235, 0.1);
    color: var(--primary-color);
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
}

.stat-value {
    font-size: 32px;
    font-weight: 700;
    margin-bottom: 8px;
}

.stat-change {
    font-size: 14px;
}

.stat-change.positive {
    color: var(--success-color);
}

.stat-change.negative {
    color: var(--danger-color);
}

/* ===== DATA TABLE ===== */
.data-table-container {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    overflow: hidden;
    margin-bottom: 24px;
}

.table-header {
    padding: 20px 24px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.table-title {
    font-size: 18px;
    font-weight: 600;
}

.table-actions {
    display: flex;
    gap: 12px;
}

.search-box {
    padding: 8px 16px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-primary);
    font-size: 14px;
    width: 250px;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
}

.data-table thead {
    background: var(--bg-tertiary);
}

.data-table th {
    padding: 16px 24px;
    text-align: left;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.data-table td {
    padding: 16px 24px;
    border-top: 1px solid var(--border-color);
    font-size: 14px;
}

.data-table tr:hover {
    background: rgba(37, 99, 235, 0.05);
}

/* ===== BADGES ===== */
.badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
}

.badge-success {
    background: rgba(16, 185, 129, 0.1);
    color: var(--success-color);
}

.badge-danger {
    background: rgba(239, 68, 68, 0.1);
    color: var(--danger-color);
}

.badge-warning {
    background: rgba(245, 158, 11, 0.1);
    color: var(--warning-color);
}

.badge-info {
    background: rgba(37, 99, 235, 0.1);
    color: var(--primary-color);
}

/* ===== MODAL ===== */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
}

.modal.show {
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background: var(--bg-card);
    border-radius: 16px;
    padding: 32px;
    width: 90%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
    animation: slideUp 0.3s ease;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}

.modal-title {
    font-size: 20px;
    font-weight: 700;
}

.modal-close {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-size: 24px;
    cursor: pointer;
}

.modal-body {
    margin-bottom: 24px;
}

.modal-footer {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
}

/* ===== LOADING ===== */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

/* ===== UTILITIES ===== */
.text-center {
    text-align: center;
}

.mb-2 {
    margin-bottom: 12px;
}

.mb-4 {
    margin-bottom: 24px;
}

.mt-2 {
    margin-top: 12px;
}

.mt-4 {
    margin-top: 24px;
}

.flex {
    display: flex;
}

.flex-gap {
    gap: 12px;
}

.justify-between {
    justify-content: space-between;
}

.items-center {
    align-items: center;
}

/ *   T a b l e   S o r t i n g   * /     . d a t a - t a b l e   t h [ d a t a - s o r t ]    {
                 c u r s o r :    p o i n t e r ;
                 u s e r - s e l e c t :    n o n e ;
                 p o s i t i o n :    r e l a t i v e ;
                 p a d d i n g - r i g h t :    3 0 p x    ! i m p o r t a n t ;
         
}

         . d a t a - t a b l e   t h [ d a t a - s o r t ] : h o v e r    {
                 b a c k g r o u n d - c o l o r :    r g b a ( 2 5 5 ,    2 5 5 ,    2 5 5 ,    0 . 0 5 ) ;
         
}

         . s o r t - i c o n    {
                 p o s i t i o n :    a b s o l u t e ;
                 r i g h t :    1 0 p x ;
                 t o p :    5 0 % ;
                 t r a n s f o r m :    t r a n s l a t e Y ( - 5 0 % ) ;
                 f o n t - s i z e :    1 1 p x ;
                 o p a c i t y :    0 . 4 ;
         
}

         . d a t a - t a b l e   t h [ d a t a - s o r t ] : h o v e r   . s o r t - i c o n    {
                 o p a c i t y :    0 . 7 ;
         
}

         . f a - s o r t - u p ,
     . f a - s o r t - d o w n    {
                 o p a c i t y :    1    ! i m p o r t a n t ;
                 c o l o r :    v a r ( - - p r i m a r y - c o l o r ) ;
         
}

         / *   F i l t e r   R o w   * /     . f i l t e r - r o w   t h    {
                 p a d d i n g :    1 0 p x   2 4 p x    ! i m p o r t a n t ;
                 b a c k g r o u n d - c o l o r :    r g b a ( 2 5 5 ,    2 5 5 ,    2 5 5 ,    0 . 0 2 ) ;
         
}

         . t a b l e - f i l t e r    {
                 w i d t h :    1 0 0 % ;
                 p a d d i n g :    6 p x   1 0 p x ;
                 b a c k g r o u n d - c o l o r :    r g b a ( 2 5 5 ,    2 5 5 ,    2 5 5 ,    0 . 0 5 ) ;
                 b o r d e r :    1 p x   s o l i d   r g b a ( 2 5 5 ,    2 5 5 ,    2 5 5 ,    0 . 1 ) ;
                 b o r d e r - r a d i u s :    6 p x ;
                 c o l o r :    v a r ( - - t e x t - p r i m a r y ) ;
                 f o n t - s i z e :    1 3 p x ;
                 f o n t - f a m i l y :    v a r ( - - f o n t - f a m i l y ) ;
         
}

         . t a b l e - f i l t e r : f o c u s    {
                 o u t l i n e :    n o n e ;
                 b o r d e r - c o l o r :    v a r ( - - p r i m a r y - c o l o r ) ;
                 b a c k g r o u n d - c o l o r :    r g b a ( 2 5 5 ,    2 5 5 ,    2 5 5 ,    0 . 0 8 ) ;
         
}

         . t a b l e - f i l t e r : : p l a c e h o l d e r    {
                 c o l o r :    v a r ( - - t e x t - m u t e d ) ;
                 o p a c i t y :    0 . 6 ;
         
}

         . t a b l e - f i l t e r   o p t i o n    {
                 b a c k g r o u n d - c o l o r :    v a r ( - - b g - t e r t i a r y ) ;
                 c o l o r :    v a r ( - - t e x t - p r i m a r y ) ;
         
}

     
/* ============== ACTION BUTTONS LAYOUT ============== */
.action-buttons {
    display: flex;
    gap: 6px;
    align-items: center;
    justify-content: flex-start;
    flex-wrap: nowrap;
    white-space: nowrap;
}

.action-buttons .btn-icon {
    padding: 6px 8px;
    min-width: 32px;
}

/* ============== COLORFUL ICON STYLES ============== */
.btn-view i { color: #3b82f6; }
.btn-wallet i { color: #10b981; }
.btn-suspend i { color: #f59e0b; }
.btn-unsuspend i { color: #22c55e; }
.btn-delete i { color: #ef4444; }

.btn-icon:hover i {
    opacity: 0.8;
}

.btn-icon:disabled i {
    color: #6b7280;
    opacity: 0.5;
}

/* ============== ACCOUNT SUSPENSION STYLES ============== */
tr.suspended {
    background-color: rgba(245, 158, 11, 0.1);
    opacity: 0.8;
}

tr.deleted {
    background-color: rgba(239, 68, 68, 0.1);
    opacity: 0.6;
    text-decoration: line-through;
}

tr.suspended:hover, tr.deleted:hover {
    opacity: 1;
}

/* ============== FORCE HORIZONTAL LAYOUT (OVERRIDE) ============== */
td .action-buttons {
    display: flex !important;
    flex-direction: row !important;
    gap: 8px !important;
    align-items: center !important;
    justify-content: flex-start !important;
}

td .action-buttons .btn-icon {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
}

/* ============== PAYMENT METHODS CARD STYLES ============== */
.payment-methods-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 20px;
}

.payment-method-card {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px;
    background: var(--bg-tertiary);
    border-radius: 8px;
    border: 1px solid var(--border-color);
}

.payment-method-card i.fab {
    font-size: 32px;
}

.payment-method-card .fa-cc-visa { color: #1434CB; }
.payment-method-card .fa-cc-mastercard { color: #EB001B; }
.payment-method-card .fa-cc-amex { color: #006FCF; }
.payment-method-card .fa-cc-discover { color: #FF6000; }

.payment-method-card .card-number {
    font-size: 16px;
    font-weight: 500;
    letter-spacing: 1px;
}

.payment-method-card .card-expiry {
    color: var(--text-secondary);
    font-size: 14px;
}

.payment-method-card .badge {
    margin-left: auto;
}

.payment-method-card .btn-delete-card {
    margin-left: 8px;
}

.payment-method-card .btn-delete-card i {
    color: var(--danger-color);
}

.no-cards-message {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-secondary);
    font-style: italic;
}

.payment-link-section {
    margin-top: 24px;
}

.payment-link-section hr {
    margin: 24px 0;
    border: none;
    border-top: 1px solid var(--border-color);
}

.btn-cards i {
    color: #8b5cf6;
}

/* ============== NATURAL LANGUAGE QUERY PAGE ============== */
.nl-query-page {
    padding: 20px;
}

.nl-query-page .page-header {
    margin-bottom: 30px;
}

.nl-query-page .page-header h2 {
    margin: 0 0 8px 0;
    color: var(--text-primary);
}

.nl-query-page .page-header p {
    color: var(--text-secondary);
    margin: 0;
}

.query-section {
    background: var(--bg-secondary);
    padding: 24px;
    border-radius: 12px;
    margin-bottom: 24px;
}

.query-input-container {
    margin-bottom: 24px;
}

.query-input-container label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: var(--text-primary);
}

.query-input-container textarea {
    width: 100%;
    padding: 12px;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    background: var(--bg-tertiary);
    color: var(--text-primary);
    font-family: inherit;
    font-size: 14px;
    resize: vertical;
    margin-bottom: 12px;
}

.query-input-container textarea:focus {
    outline: none;
    border-color: var(--primary-color);
}

.examples-section h4 {
    margin: 0 0 16px 0;
    color: var(--text-primary);
}

.example-questions-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 12px;
}

.example-question {
    padding: 12px 16px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-primary);
    cursor: pointer;
    transition: all 0.2s;
    text-align: left;
    font-size: 13px;
}

.example-question:hover {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
    transform: translateY(-2px);
}

.query-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 40px;
    background: var(--bg-secondary);
    border-radius: 12px;
    margin-bottom: 24px;
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid var(--border-color);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

.query-loading p {
    margin-top: 16px;
    color: var(--text-secondary);
}

.sql-container {
    background: var(--bg-secondary);
    padding: 20px;
    border-radius: 12px;
    margin-bottom: 24px;
}

.sql-container h3 {
   margin: 0 0 12px 0;
    color: var(--text-primary);
}

.sql-container pre {
    background: var(--bg-tertiary);
    padding: 16px;
    border-radius: 8px;
    overflow-x: auto;
    margin: 0;
}

.sql-container code {
    color: #4ec9b0;
    font-family: 'Courier New', monospace;
    font-size: 13px;
}

.results-section {
    background: var(--bg-secondary);
    padding: 20px;
    border-radius: 12px;
}

.results-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.results-header h3 {
    margin: 0;
    color: var(--text-primary);
}

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

.no-results {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-secondary);
}

.no-results i {
    font-size: 48px;
    margin-bottom: 16px;
    opacity: 0.5;
}

.null-value {
    color: var(--text-tertiary);
    font-style: italic;
}
