/* Expense BCG - Main Styles */
/* VER: 1.0 - 2026-07-31 */

:root {
    --color-primary: #000000;
    --color-primary-hover: #1a1a1a;
    --color-accent: #f47b20;
    --color-accent-hover: #e06810;
    --color-accent-light: rgba(244, 123, 32, 0.1);
    --color-success: #34c759;
    --color-warning: #f7a736;
    --color-danger: #ff3b30;
    --color-info: #007aff;
    --color-bg: #ffffff;
    --color-bg-secondary: #f8f9fa;
    --color-bg-tertiary: #f0f0f0;
    --color-text: #1a1a1a;
    --color-text-secondary: #6b7280;
    --color-text-muted: #9ca3af;
    --color-border: #e6e6e6;
    --color-border-light: #f0f0f0;
    --color-link: #464feb;
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 20px;
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.06);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 12px 32px rgba(0, 0, 0, 0.12);
    --font-family: -apple-system, BlinkMacSystemFont, "San Francisco", "Segoe UI", Roboto, Arial, sans-serif;
    --transition: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

* {
    box-sizing: border-box;
}

body {
    font-family: var(--font-family);
    background: var(--color-bg);
    color: var(--color-text);
    margin: 0;
    padding: 0;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

a {
    text-decoration: none;
    color: var(--color-link);
    transition: color var(--transition);
}

a:hover {
    color: var(--color-accent);
}

/* Header */
.header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--color-border);
    padding: 0 24px;
    height: 64px;
}

.header-content {
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 100%;
    gap: 16px;
}

.header-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    color: var(--color-text);
}

.header-brand .logo-icon {
    width: 36px;
    height: 36px;
    background: var(--color-primary);
    color: #fff;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 13px;
}

.brand-name {
    font-size: 18px;
    font-weight: 700;
    letter-spacing: -0.3px;
}

.header-nav {
    display: flex;
    align-items: center;
    gap: 4px;
}

.header-nav a {
    padding: 8px 14px;
    border-radius: var(--radius-sm);
    color: var(--color-text-secondary);
    font-size: 14px;
    font-weight: 500;
    transition: all var(--transition);
}

.header-nav a:hover,
.header-nav a.active {
    background: var(--color-bg-secondary);
    color: var(--color-text);
}

.header-nav a.active {
    font-weight: 600;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

/* Language switcher */
.language-switcher {
    display: flex;
    gap: 2px;
    background: var(--color-bg-secondary);
    border-radius: var(--radius-sm);
    padding: 3px;
}

.lang-option {
    padding: 5px 10px;
    font-size: 12px;
    font-weight: 600;
    border-radius: 6px;
    cursor: pointer;
    color: var(--color-text-secondary);
    transition: all var(--transition);
    user-select: none;
}

.lang-option:hover {
    color: var(--color-text);
}

.lang-option.active {
    background: #fff;
    color: var(--color-text);
    box-shadow: var(--shadow-sm);
}

/* User menu */
.user-menu {
    position: relative;
}

.user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--color-primary);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: transform var(--transition);
}

.user-avatar:hover {
    transform: scale(1.05);
}

/* Main container */
.main-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 32px 24px;
}

/* Cards */
.card {
    background: #fff;
    border-radius: var(--radius-lg);
    border: 1px solid var(--color-border);
    box-shadow: var(--shadow-sm);
    margin-bottom: 24px;
    overflow: hidden;
}

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

.card-header h2 {
    font-size: 18px;
    font-weight: 700;
    margin: 0;
    letter-spacing: -0.3px;
}

.card-body {
    padding: 24px;
}

/* Forms */
.form-group {
    margin-bottom: 20px;
}

.form-label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--color-text);
    margin-bottom: 6px;
}

.form-input {
    width: 100%;
    padding: 12px 14px;
    font-size: 15px;
    font-family: var(--font-family);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    background: #fff;
    color: var(--color-text);
    transition: all var(--transition);
    outline: none;
}

.form-input:focus {
    border-color: var(--color-accent);
    box-shadow: 0 0 0 4px rgba(244, 123, 32, 0.12);
}

.form-input::placeholder {
    color: var(--color-text-muted);
}

.form-select {
    width: 100%;
    padding: 12px 14px;
    font-size: 15px;
    font-family: var(--font-family);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    background: #fff;
    color: var(--color-text);
    cursor: pointer;
    outline: none;
    transition: all var(--transition);
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%236b7280' viewBox='0 0 16 16'%3E%3Cpath d='M8 11L3 6h10l-5 5z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
    padding-right: 36px;
}

.form-select:focus {
    border-color: var(--color-accent);
    box-shadow: 0 0 0 4px rgba(244, 123, 32, 0.12);
}

textarea.form-input {
    resize: vertical;
    min-height: 80px;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 18px;
    font-size: 14px;
    font-weight: 600;
    font-family: var(--font-family);
    border-radius: var(--radius-md);
    border: none;
    cursor: pointer;
    transition: all var(--transition);
    text-decoration: none;
    line-height: 1.4;
    white-space: nowrap;
}

.btn-primary {
    background: var(--color-primary);
    color: #fff;
}

.btn-primary:hover {
    background: var(--color-primary-hover);
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.btn-accent {
    background: var(--color-accent);
    color: #fff;
}

.btn-accent:hover {
    background: var(--color-accent-hover);
    transform: translateY(-1px);
}

.btn-secondary {
    background: var(--color-bg-secondary);
    color: var(--color-text);
    border: 1px solid var(--color-border);
}

.btn-secondary:hover {
    background: var(--color-bg-tertiary);
}

.btn-danger {
    background: var(--color-danger);
    color: #fff;
}

.btn-danger:hover {
    background: #e0342b;
}

.btn-success {
    background: var(--color-success);
    color: #fff;
}

.btn-success:hover {
    background: #2ab548;
}

.btn-sm {
    padding: 6px 12px;
    font-size: 13px;
    border-radius: var(--radius-sm);
}

.btn-lg {
    padding: 14px 24px;
    font-size: 16px;
}

/* Alerts */
.alert {
    padding: 12px 16px;
    border-radius: var(--radius-md);
    font-size: 14px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.alert-success {
    background: rgba(52, 199, 89, 0.1);
    color: #1a7a34;
    border: 1px solid rgba(52, 199, 89, 0.2);
}

.alert-error {
    background: rgba(255, 59, 48, 0.08);
    color: #c52922;
    border: 1px solid rgba(255, 59, 48, 0.2);
}

.alert-warning {
    background: rgba(247, 167, 54, 0.1);
    color: #8a5a1a;
    border: 1px solid rgba(247, 167, 54, 0.2);
}

.alert-info {
    background: rgba(0, 122, 255, 0.08);
    color: #0055b3;
    border: 1px solid rgba(0, 122, 255, 0.15);
}

/* Badges */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    font-size: 12px;
    font-weight: 600;
    border-radius: 20px;
    white-space: nowrap;
}

.badge-primary {
    background: rgba(0, 122, 255, 0.1);
    color: #007aff;
}

.badge-success {
    background: rgba(52, 199, 89, 0.1);
    color: #1a7a34;
}

.badge-warning {
    background: rgba(247, 167, 54, 0.12);
    color: #8a5a1a;
}

.badge-danger {
    background: rgba(255, 59, 48, 0.1);
    color: #c52922;
}

.badge-info {
    background: rgba(0, 122, 255, 0.08);
    color: #0055b3;
}

.badge-secondary {
    background: var(--color-bg-secondary);
    color: var(--color-text-secondary);
}

/* Tables */
.table-wrapper {
    overflow-x: auto;
    border-radius: var(--radius-md);
}

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

tr th,
tr td {
    border: 1px solid var(--color-border);
    padding: 12px 16px;
    text-align: left;
}

tr th {
    background-color: var(--color-bg-secondary);
    font-weight: 600;
    font-size: 13px;
    color: var(--color-text-secondary);
    white-space: nowrap;
}

tr td {
    vertical-align: middle;
}

tbody tr:hover {
    background: var(--color-bg-secondary);
}

/* Stats cards */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    margin-bottom: 32px;
}

.stat-card {
    background: #fff;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    padding: 20px 24px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.stat-card .stat-value {
    font-size: 28px;
    font-weight: 700;
    letter-spacing: -0.5px;
    color: var(--color-text);
}

.stat-card .stat-label {
    font-size: 13px;
    color: var(--color-text-secondary);
    font-weight: 500;
}

.stat-card.accent {
    border-color: rgba(244, 123, 32, 0.3);
    background: linear-gradient(135deg, rgba(244, 123, 32, 0.04), rgba(244, 123, 32, 0.01));
}

.stat-card.accent .stat-value {
    color: var(--color-accent);
}

/* Page header */
.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 28px;
    gap: 16px;
    flex-wrap: wrap;
}

.page-title {
    font-size: 26px;
    font-weight: 700;
    letter-spacing: -0.5px;
    margin: 0;
}

/* Empty state */
.empty-state {
    text-align: center;
    padding: 60px 24px;
    color: var(--color-text-secondary);
}

.empty-state-icon {
    font-size: 48px;
    margin-bottom: 16px;
    opacity: 0.4;
}

.empty-state h3 {
    font-size: 18px;
    color: var(--color-text);
    margin: 0 0 8px;
}

.empty-state p {
    font-size: 14px;
    margin: 0;
}

/* Modals */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.modal-overlay[style*="display: flex"],
.modal-overlay[style*="display:flex"] {
    display: flex !important;
}

.modal-content {
    background: #fff;
    border-radius: var(--radius-lg);
    padding: 28px;
    width: 100%;
    max-width: 540px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

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

.modal-header h2 {
    font-size: 18px;
    margin: 0;
}

.modal-close {
    background: none;
    border: none;
    font-size: 28px;
    cursor: pointer;
    color: var(--color-text-secondary);
    line-height: 1;
    padding: 0 4px;
}

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

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    margin-top: 20px;
    padding-top: 16px;
    border-top: 1px solid var(--color-border);
}

/* Pagination */
.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    margin-top: 24px;
}

.pagination a,
.pagination span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    height: 36px;
    padding: 0 10px;
    font-size: 14px;
    font-weight: 500;
    border-radius: var(--radius-sm);
    color: var(--color-text-secondary);
    transition: all var(--transition);
}

.pagination a:hover {
    background: var(--color-bg-secondary);
    color: var(--color-text);
}

.pagination .active {
    background: var(--color-primary);
    color: #fff;
}

/* Utilities */
.text-center {
    text-align: center;
}

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

.text-muted {
    color: var(--color-text-secondary);
}

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

.mb-1 {
    margin-bottom: 4px;
}

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

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

.font-bold {
    font-weight: 700;
}

.mt-1 {
    margin-top: 8px;
}

.mt-2 {
    margin-top: 16px;
}

.mt-3 {
    margin-top: 24px;
}

.mb-1 {
    margin-bottom: 8px;
}

.mb-2 {
    margin-bottom: 16px;
}

.mb-3 {
    margin-bottom: 24px;
}

.mb-4 {
    margin-bottom: 32px;
}

/* Mobile responsive */
@media (max-width: 768px) {
    .header {
        padding: 0 16px;
        height: 56px;
    }

    .header-nav {
        display: none;
    }

    .main-container {
        padding: 20px 16px;
    }

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

    .page-title {
        font-size: 22px;
    }

    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }

    .stat-card {
        padding: 16px;
    }

    .stat-card .stat-value {
        font-size: 22px;
    }

    .card-header {
        padding: 16px 20px;
    }

    .card-body {
        padding: 20px;
    }

    /* Table to cards on mobile */
    .table-responsive-cards table,
    .table-responsive-cards thead,
    .table-responsive-cards tbody,
    .table-responsive-cards tr,
    .table-responsive-cards th,
    .table-responsive-cards td {
        display: block;
    }

    .table-responsive-cards thead {
        display: none;
    }

    .table-responsive-cards tr {
        border: 1px solid var(--color-border);
        border-radius: var(--radius-md);
        padding: 16px;
        margin-bottom: 12px;
        background: #fff;
    }

    .table-responsive-cards td {
        border: none;
        padding: 4px 0;
        font-size: 14px;
    }

    .table-responsive-cards td::before {
        content: attr(data-label);
        font-weight: 600;
        font-size: 12px;
        color: var(--color-text-secondary);
        display: block;
        margin-bottom: 2px;
    }
}

@media (max-width: 480px) {
    .stats-grid {
        grid-template-columns: 1fr;
    }
}

/* ==============================
   Mobile Navigation
============================== */
.mobile-menu-toggle {
    display: none;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    width: 36px;
    height: 36px;
    padding: 6px;
    background: none;
    border: none;
    cursor: pointer;
    border-radius: var(--radius-sm);
}

.mobile-menu-toggle span {
    display: block;
    width: 100%;
    height: 2px;
    background: var(--color-text-primary);
    border-radius: 2px;
    transition: transform 0.3s, opacity 0.3s;
}

.mobile-menu-toggle.open span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}

.mobile-menu-toggle.open span:nth-child(2) {
    opacity: 0;
}

.mobile-menu-toggle.open span:nth-child(3) {
    transform: rotate(-45deg) translate(5px, -5px);
}

.mobile-nav {
    display: none;
    flex-direction: column;
    background: #fff;
    border-bottom: 1px solid var(--color-border);
    padding: 0 20px 16px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.mobile-nav.open {
    display: flex;
}

.mobile-nav a {
    padding: 12px 0;
    font-size: 15px;
    font-weight: 500;
    color: var(--color-text-primary);
    text-decoration: none;
    border-bottom: 1px solid var(--color-border-light);
}

.mobile-nav a:last-child {
    border-bottom: none;
}

.mobile-nav a.active {
    color: var(--color-accent);
}

@media (max-width: 768px) {
    .mobile-menu-toggle {
        display: flex;
    }

    .header-nav {
        display: none;
    }

    .header-actions .language-switcher,
    .header-actions .user-menu,
    .header-actions>.btn {
        display: none;
    }
}