:root {
    /* Brand Colors - GTB Orange Focus */
    --brand-primary: #DD5928;
    --brand-dark: #B8451B;
    --brand-light: #FF7B4A;
    --brand-subtle: #FFF1EC;
    
    /* Sleek Surfaces */
    --bg-main: #FAFAFA; /* Extremely light, soft background */
    --bg-surface: #FFFFFF; /* Pure white cards */
    --bg-hover: #F3F4F6;
    
    /* Soft Borders */
    --border-light: rgba(0,0,0,0.04);
    
    /* Text */
    --text-primary: #111827;
    --text-secondary: #6B7280;
    --text-muted: #9CA3AF;
    
    /* Status */
    --success: #10B981;
    --warning: #F59E0B;
    --danger: #EF4444;
    
    /* Sleek Shadows */
    --shadow-soft: 0 10px 40px -10px rgba(0,0,0,0.04);
    --shadow-hover: 0 20px 40px -10px rgba(0,0,0,0.08);
    
    /* Typography */
    --font-heading: 'Outfit', sans-serif;
    --font-body: 'Inter', sans-serif;
}

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

body.app-body {
    font-family: var(--font-body);
    background-color: var(--bg-main);
    color: var(--text-primary);
    display: flex;
    height: 100vh;
    overflow: hidden;
    -webkit-font-smoothing: antialiased;
}

/* Utilities */
.text-brand { color: var(--brand-primary); }
.text-success { color: var(--success); }
.text-warning { color: var(--warning); }
.text-danger { color: var(--danger); }
.text-muted { color: var(--text-muted); }

.bg-brand { background-color: var(--brand-primary); }
.bg-alt { background-color: var(--bg-hover); }

.icon-xs { width: 14px; height: 14px; }
.icon-sm { width: 18px; height: 18px; }

.mt-10 { margin-top: 10px; }
.mt-24 { margin-top: 24px; }
.p-0 { padding: 0 !important; }
.truncate {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.w-100 { width: 100%; }

.link-brand {
    color: var(--brand-primary);
    text-decoration: none;
    font-weight: 500;
    font-size: 14px;
    transition: opacity 0.2s;
}
.link-brand:hover { opacity: 0.7; }

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px;
    border-radius: 12px;
    font-weight: 500;
    font-family: var(--font-body);
    cursor: pointer;
    border: none;
    transition: all 0.2s ease;
    font-size: 14px;
}

.btn-primary {
    background: var(--text-primary); /* Use dark primary for less distraction, orange for brand */
    color: #fff;
}
.btn-primary:hover {
    background: #000;
    transform: translateY(-2px);
}

.btn-secondary {
    background: var(--bg-hover);
    color: var(--text-primary);
}
.btn-secondary:hover {
    background: #E5E7EB;
}

.btn-sm {
    padding: 8px 16px;
    font-size: 13px;
    border-radius: 8px;
}

/* Sidebar - Sleek & Borderless */
.sidebar {
    width: 260px;
    background: transparent;
    display: flex;
    flex-direction: column;
    padding: 32px 20px;
    flex-shrink: 0;
    transition: width 0.3s ease, padding 0.3s ease;
    overflow-y: auto;
    overflow-x: hidden;
    scroll-behavior: smooth;
}

/* Modern smooth scrollbar for sidebar */
.sidebar::-webkit-scrollbar {
    width: 6px;
}
.sidebar::-webkit-scrollbar-track {
    background: transparent;
}
.sidebar::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.1);
    border-radius: 10px;
}
.sidebar::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 0, 0, 0.2);
}

.sidebar.collapsed {
    width: 88px;
    padding: 32px 16px;
}

.sidebar.collapsed .logo span { display: none; }
.sidebar.collapsed .logo { font-size: 28px; text-align: center; display: block; }
.sidebar.collapsed .nav-label { opacity: 0; pointer-events: none; height: 0; margin: 0; overflow: hidden; padding: 0; }
.sidebar.collapsed .nav-item span { display: none; }
.sidebar.collapsed .nav-item { justify-content: center; padding: 12px; gap: 0; }
.sidebar.collapsed .nav-item i { margin: 0; }

.sidebar-header {
    padding: 0 16px 40px;
}

.logo {
    font-family: var(--font-heading);
    font-size: 24px;
    font-weight: 700;
    color: var(--text-primary);
    text-decoration: none;
    letter-spacing: -0.5px;
}
.logo span { color: var(--brand-primary); }

.nav-section {
    margin-bottom: 32px;
}

.nav-label {
    padding: 0 16px;
    font-size: 11px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 16px;
}

.side-nav {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 12px 16px;
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 500;
    font-size: 14px;
    border-radius: 12px;
    transition: all 0.2s;
}

.nav-item i { width: 18px; height: 18px; opacity: 0.7; }

.nav-item:hover {
    color: var(--text-primary);
}
.nav-item:hover i { opacity: 1; }

.nav-item.active {
    background: var(--bg-surface);
    color: var(--text-primary);
    box-shadow: var(--shadow-soft);
}
.nav-item.active i {
    color: var(--brand-primary);
    opacity: 1;
}

.sidebar-footer {
    margin-top: auto;
}

/* Main Content Area */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
    background: var(--bg-surface);
    border-radius: 32px 0 0 32px;
    box-shadow: -10px 0 40px rgba(0,0,0,0.02);
}

/* Topbar - Borderless & Clean */
.topbar {
    height: 88px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 48px;
    flex-shrink: 0;
    position: relative;
    z-index: 1050;
}

.topbar-left {
    display: flex;
    align-items: center;
    gap: 24px;
}

.search-bar {
    display: flex;
    align-items: center;
    gap: 12px;
    background: var(--bg-main);
    padding: 12px 20px;
    border-radius: 12px;
    width: 400px;
}
.search-bar input {
    border: none;
    background: transparent;
    width: 100%;
    font-family: var(--font-body);
    font-size: 14px;
    color: var(--text-primary);
    outline: none;
}
.search-bar input::placeholder { color: var(--text-muted); }

.topbar-actions {
    display: flex;
    align-items: center;
    gap: 24px;
}

.icon-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    position: relative;
    padding: 10px;
    border-radius: 50%;
    transition: background 0.2s;
}
.icon-btn:hover { background: var(--bg-main); }

.notification-dot {
    position: absolute;
    top: 6px;
    right: 6px;
    width: 10px;
    height: 10px;
    background: var(--brand-primary);
    border-radius: 50%;
    border: 2px solid var(--bg-surface);
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    padding-left: 24px;
}

.avatar {
    width: 40px;
    height: 40px;
    background: var(--bg-main);
    color: var(--text-primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 500;
    font-size: 14px;
}

.user-details {
    display: flex;
    flex-direction: column;
    justify-content: center;
}
.user-name { font-size: 14px; font-weight: 600; line-height: 1.2; margin-bottom: 2px; }
.user-role { font-size: 12px; color: var(--text-muted); line-height: 1.2; }

/* Dashboard Scroll Area */
.dashboard-scroll-area {
    flex: 1;
    overflow-y: auto;
    padding: 24px 48px 48px;
}

/* Welcome Banner */
.welcome-banner {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    margin-bottom: 48px;
}

.page-title {
    font-size: 32px;
    font-weight: 400;
    margin-bottom: 8px;
    letter-spacing: -0.5px;
}

.page-subtitle {
    color: var(--text-secondary);
    font-size: 15px;
}

/* Stats Grid - Minimalist */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
    margin-bottom: 48px;
}

.stat-card {
    background: var(--bg-main);
    border-radius: 20px;
    padding: 28px;
    border: 1px solid var(--border-light);
}

.stat-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 24px;
}

.stat-icon-wrapper {
    color: var(--text-secondary);
}

.trend {
    font-size: 12px;
    font-weight: 500;
    color: var(--text-secondary);
}
.trend.positive { color: var(--success); }

.stat-value {
    font-size: 36px;
    font-weight: 400;
    font-family: var(--font-heading);
    margin-bottom: 4px;
    letter-spacing: -1px;
}

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

/* Layout Grid */
.dashboard-layout {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 40px;
}

.section-header-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}

.section-heading {
    font-size: 18px;
    font-weight: 500;
}

/* Tab Navigation - Modern & Premium */
.tabs {
    display: flex;
    gap: 32px;
    border-bottom: 1px solid var(--border-light);
    margin-bottom: 32px;
}

.tab {
    padding: 12px 4px;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-muted);
    text-decoration: none;
    position: relative;
    transition: all 0.2s ease;
}

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

.tab.active {
    color: var(--brand-primary);
}

.tab.active::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 0;
    width: 100%;
    height: 2px;
    background: var(--brand-primary);
    border-radius: 2px;
}

/* Tab Content Visibility */
.tab-content {
    animation: fadeIn 0.3s ease;
}

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

/* Cycle Cards */
.cycle-cards {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.cycle-card {
    border: 1px solid var(--border-light);
    border-radius: 20px;
    padding: 28px;
    transition: box-shadow 0.2s;
}
.cycle-card:hover {
    box-shadow: var(--shadow-soft);
}

.cycle-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 32px;
}

.cycle-title h4 {
    font-size: 16px;
    font-weight: 500;
    margin-bottom: 8px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 240px;
    display: flex;
    align-items: center;
    gap: 4px;
}

.cycle-title h4.expanded {
    white-space: normal;
    overflow: visible;
    max-width: 100%;
}

.title-toggle-btn {
    background: none;
    border: none;
    padding: 2px;
    cursor: pointer;
    color: var(--brand-primary);
    display: flex;
    align-items: center;
    border-radius: 4px;
}
.title-toggle-btn:hover { background: var(--brand-subtle); }

.cycle-status {
    display: inline-block;
    font-size: 12px;
    font-weight: 500;
    color: var(--text-secondary);
}
.cycle-status.active { color: var(--success); }
.cycle-status.active::before { content: "•"; margin-right: 4px; color: var(--success); }
.cycle-status.pending { color: var(--warning); }
.cycle-status.pending::before { content: "•"; margin-right: 4px; color: var(--warning); }

.cycle-amount {
    text-align: right;
}
.cycle-amount strong {
    display: block;
    font-size: 20px;
    font-weight: 400;
    font-family: var(--font-heading);
}
.cycle-amount span {
    font-size: 12px;
    color: var(--text-muted);
}

.cycle-progress {
    margin-bottom: 24px;
}

.progress-info {
    display: flex;
    justify-content: space-between;
    font-size: 13px;
    margin-bottom: 12px;
    color: var(--text-secondary);
}

.progress-bar {
    height: 4px;
    background: var(--bg-main);
    border-radius: 2px;
    overflow: hidden;
}
.progress-fill { height: 100%; border-radius: 2px; }

.cycle-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.queue-info {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: var(--text-secondary);
}
.queue-info strong { color: var(--text-primary); font-weight: 500; }

/* Transaction List - Sleek */
.transaction-list {
    display: flex;
    flex-direction: column;
}

.transaction-item {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px 0;
    border-bottom: 1px solid var(--border-light);
}
.transaction-item:last-child { border-bottom: none; }

.tx-icon {
    width: 40px;
    height: 40px;
    background: var(--bg-main);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.tx-details { flex: 1; }
.tx-details h4 { font-size: 14px; font-weight: 500; margin-bottom: 2px; }
.tx-details p { font-size: 12px; color: var(--text-muted); }

.tx-amount {
    font-size: 14px;
    font-weight: 500;
}
.tx-amount.positive { color: var(--success); }

/* Upgrade Banner */
.upgrade-banner {
    background: var(--brand-subtle);
    border-radius: 20px;
    padding: 32px;
    text-align: center;
    border: none;
}

.upgrade-icon {
    width: 48px;
    height: 48px;
    background: #fff;
    color: var(--brand-primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 16px;
}

.upgrade-banner h3 {
    font-size: 16px;
    font-weight: 500;
    color: var(--brand-dark);
    margin-bottom: 8px;
}

.upgrade-banner p {
    font-size: 13px;
    color: var(--brand-dark);
    opacity: 0.8;
}

.upgrade-banner .btn {
    background: #fff;
    color: var(--brand-primary);
    border: 1px solid transparent;
}
.upgrade-banner .btn:hover { border-color: var(--brand-primary); }

/* Ledger Table */
.ledger-table-container {
    background: var(--bg-surface);
    border: 1px solid var(--border-light);
    border-radius: 20px;
    overflow: hidden;
}

.ledger-table {
    width: 100%;
    border-collapse: collapse;
}
.ledger-table th {
    text-align: left;
    padding: 16px 24px;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-muted);
    border-bottom: 1px solid var(--border-light);
    background: var(--bg-main);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.ledger-table th:first-child, .ledger-table td:first-child { padding-left: 32px; }
.ledger-table th:last-child, .ledger-table td:last-child { padding-right: 32px; }

.ledger-table td {
    padding: 20px 24px;
    font-size: 14px;
    color: var(--text-primary);
    border-bottom: 1px solid var(--border-light);
    vertical-align: middle;
}
.ledger-table tr:last-child td { border-bottom: none; }
.ledger-table tr:hover td { background: var(--bg-main); }

.tx-type { display: flex; align-items: center; gap: 12px; }
.tx-type i { width: 16px; height: 16px; }

/* Trust Score Circle */
.trust-circle-container {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 40px;
}

.trust-circle {
    width: 280px;
    height: 280px;
    border-radius: 50%;
    background: conic-gradient(var(--brand-primary) var(--trust-percentage, 0%), var(--border-light) 0);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    box-shadow: var(--shadow-soft);
}

.trust-circle-inner {
    width: 240px;
    height: 240px;
    background: var(--bg-surface);
    border-radius: 50%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    box-shadow: inset 0 2px 10px rgba(0,0,0,0.02);
}

.trust-score-big {
    font-size: 80px;
    font-weight: 400;
    font-family: var(--font-heading);
    color: var(--brand-primary);
    line-height: 1;
    letter-spacing: -2px;
}

.trust-circle-label {
    font-size: 14px;
    color: var(--text-muted);
    margin-top: 8px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.type-btn-label input:checked + div {
    border-color: var(--brand-primary) !important;
    background: var(--brand-subtle) !important;
    color: var(--brand-primary) !important;
    box-shadow: 0 0 0 1px var(--brand-primary);
}

/* Modals */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 23, 42, 0.7);
    backdrop-filter: blur(8px);
    display: none; 
    z-index: 2000;
    overflow-y: auto;
    padding: 0 20px;
}

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

.modal-content {
    background: var(--bg-surface);
    width: 100%;
    max-width: 550px;
    border-radius: 24px;
    padding: 32px;
    position: relative;
    box-shadow: 0 20px 40px rgba(0,0,0,0.2);
    margin: 60px auto;
    transition: transform 0.3s ease;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}
.modal-title {
    font-size: 20px;
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 380px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.modal-title.expanded {
    white-space: normal;
    overflow: visible;
    max-width: 90%;
}
.modal-close {
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 4px;
    border-radius: 8px;
}
.modal-close:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

/* Toast Notifications */
.toast-container {
    position: fixed;
    top: 32px;
    right: 32px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    z-index: 9999;
    pointer-events: none;
}

.toast {
    background: var(--bg-surface);
    color: var(--text-primary);
    padding: 16px 24px;
    border-radius: 16px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.1);
    border: 1px solid var(--border-light);
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 300px;
    max-width: 450px;
    animation: toastIn 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    pointer-events: auto;
}

.toast.success { border-left: 4px solid var(--success); }
.toast.error { border-left: 4px solid var(--danger); }
.toast.info { border-left: 4px solid var(--brand-primary); }

.toast-icon {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

.toast-content {
    font-size: 14px;
    font-weight: 500;
    line-height: 1.4;
}

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

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