@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');

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

:root {
    /* Light Theme Colors - Flat & Minimalist */
    --white: #ffffff;
    --gray-50: #fafafa;
    --gray-100: #f5f5f5;
    --gray-200: #eeeeee;
    --gray-300: #e0e0e0;
    --gray-400: #bdbdbd;
    --gray-500: #9e9e9e;
    --gray-600: #757575;
    --gray-700: #616161;
    --gray-800: #424242;
    --gray-900: #212121;
    --black: #000000;
    
    /* Brand Colors - Flat */
    --primary: #1a73e8;
    --primary-light: #4285f4;
    --primary-dark: #1557b0;
    --secondary: #202124;
    
    /* Status Colors */
    --success: #0f9d58;
    --warning: #f9ab00;
    --error: #ea4335;
    --info: #1a73e8;
    
    /* Shadows - Subtle & Flat */
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-xl: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    
    /* Border Radius */
    --radius-sm: 4px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --radius-xl: 16px;
    --radius-full: 9999px;
    
    /* Transitions */
    --transition-fast: 150ms ease;
    --transition-base: 250ms ease;
    --transition-slow: 350ms ease;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', sans-serif;
    background: var(--gray-50);
    color: var(--gray-900);
    line-height: 1.6;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ========== Scrollbar ========== */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--gray-100);
}

::-webkit-scrollbar-thumb {
    background: var(--gray-400);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--gray-500);
}

/* ========== Card Component ========== */
.card {
    background: var(--white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    transition: box-shadow var(--transition-base);
}

.card:hover {
    box-shadow: var(--shadow-lg);
}

.card-flat {
    background: var(--white);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-lg);
}

/* ========== Button Components ========== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 24px;
    font-size: 14px;
    font-weight: 500;
    border-radius: var(--radius-md);
    border: none;
    cursor: pointer;
    transition: all var(--transition-base);
    text-decoration: none;
    white-space: nowrap;
}

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

.btn-primary:hover {
    background: var(--primary-dark);
    box-shadow: var(--shadow-md);
}

.btn-secondary {
    background: var(--gray-100);
    color: var(--gray-900);
}

.btn-secondary:hover {
    background: var(--gray-200);
}

.btn-outline {
    background: transparent;
    border: 1px solid var(--gray-300);
    color: var(--gray-700);
}

.btn-outline:hover {
    background: var(--gray-50);
    border-color: var(--gray-400);
}

.btn-text {
    background: transparent;
    color: var(--primary);
    padding: 8px 12px;
}

.btn-text:hover {
    background: rgba(26, 115, 232, 0.08);
}

.btn-sm {
    padding: 6px 16px;
    font-size: 13px;
}

.btn-lg {
    padding: 14px 32px;
    font-size: 15px;
}

/* ========== Input Components ========== */
.input {
    width: 100%;
    padding: 12px 16px;
    font-size: 14px;
    font-family: inherit;
    background: var(--white);
    border: 1px solid var(--gray-300);
    border-radius: var(--radius-md);
    color: var(--gray-900);
    transition: all var(--transition-fast);
}

.input:hover {
    border-color: var(--gray-400);
}

.input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(26, 115, 232, 0.1);
}

.input::placeholder {
    color: var(--gray-500);
}

.input:disabled {
    background: var(--gray-100);
    cursor: not-allowed;
}

select.input {
    cursor: pointer;
    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 12px center;
    background-repeat: no-repeat;
    background-size: 16px;
    padding-right: 40px;
}

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

/* ========== Top Navigation ========== */
.top-nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 64px;
    background: var(--white);
    border-bottom: 1px solid var(--gray-200);
    z-index: 100;
    display: flex;
    align-items: center;
    padding: 0 24px;
}

.nav-container {
    max-width: 1600px;
    width: 100%;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.nav-logo {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    color: var(--gray-900);
    font-weight: 600;
    font-size: 18px;
}

.nav-logo-icon {
    width: 36px;
    height: 36px;
    background: var(--primary);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--white);
}

.nav-menu {
    display: flex;
    align-items: center;
    gap: 4px;
    list-style: none;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    color: var(--gray-700);
    text-decoration: none;
    border-radius: var(--radius-md);
    font-size: 14px;
    font-weight: 500;
    transition: all var(--transition-fast);
}

.nav-link:hover {
    background: var(--gray-100);
    color: var(--gray-900);
}

.nav-link.active {
    background: rgba(26, 115, 232, 0.08);
    color: var(--primary);
}

.nav-actions {
    display: flex;
    align-items: center;
    gap: 16px;
}

.nav-balance {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: var(--gray-100);
    border-radius: var(--radius-full);
    font-size: 14px;
    font-weight: 600;
    color: var(--gray-900);
}

.nav-user {
    position: relative;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 12px;
    border-radius: var(--radius-full);
    cursor: pointer;
    transition: background var(--transition-fast);
}

.nav-user:hover {
    background: var(--gray-100);
}

.nav-user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    overflow: hidden;
}

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

.nav-user-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    width: 240px;
    background: var(--white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xl);
    padding: 8px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px);
    transition: all var(--transition-base);
}

.nav-user:hover .nav-user-dropdown {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.nav-dropdown-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    color: var(--gray-700);
    text-decoration: none;
    border-radius: var(--radius-md);
    font-size: 14px;
    transition: background var(--transition-fast);
}

.nav-dropdown-link:hover {
    background: var(--gray-100);
}

.nav-dropdown-link.danger {
    color: var(--error);
}

.nav-dropdown-link.danger:hover {
    background: rgba(234, 67, 53, 0.08);
}

.nav-mobile-toggle {
    display: none;
    width: 40px;
    height: 40px;
    background: transparent;
    border: none;
    border-radius: var(--radius-md);
    color: var(--gray-700);
    cursor: pointer;
    transition: background var(--transition-fast);
}

.nav-mobile-toggle:hover {
    background: var(--gray-100);
}

/* ========== Main Content ========== */
.main-content {
    padding-top: 64px;
    min-height: 100vh;
}

.container {
    max-width: 1600px;
    margin: 0 auto;
    padding: 32px 24px;
}

.container-sm {
    max-width: 1200px;
}

.container-xs {
    max-width: 800px;
}

/* ========== Page Header ========== */
.page-header {
    margin-bottom: 32px;
}

.page-title {
    font-size: 32px;
    font-weight: 700;
    color: var(--gray-900);
    margin-bottom: 8px;
    letter-spacing: -0.5px;
}

.page-subtitle {
    font-size: 14px;
    color: var(--gray-600);
}

/* ========== Grid System ========== */
.grid {
    display: grid;
    gap: 24px;
}

.grid-cols-2 {
    grid-template-columns: repeat(2, 1fr);
}

.grid-cols-3 {
    grid-template-columns: repeat(3, 1fr);
}

.grid-cols-4 {
    grid-template-columns: repeat(4, 1fr);
}

/* ========== Stats Card ========== */
.stat-card {
    background: var(--white);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-lg);
    padding: 24px;
}

.stat-label {
    font-size: 13px;
    color: var(--gray-600);
    margin-bottom: 8px;
    font-weight: 500;
}

.stat-value {
    font-size: 32px;
    font-weight: 700;
    color: var(--gray-900);
    letter-spacing: -1px;
}

.stat-icon {
    width: 48px;
    height: 48px;
    background: var(--gray-100);
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    margin-bottom: 16px;
}

/* ========== Badge Component ========== */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    font-size: 12px;
    font-weight: 500;
    border-radius: var(--radius-full);
}

.badge-primary {
    background: rgba(26, 115, 232, 0.1);
    color: var(--primary);
}

.badge-success {
    background: rgba(15, 157, 88, 0.1);
    color: var(--success);
}

.badge-warning {
    background: rgba(249, 171, 0, 0.1);
    color: var(--warning);
}

.badge-error {
    background: rgba(234, 67, 53, 0.1);
    color: var(--error);
}

.badge-gray {
    background: var(--gray-100);
    color: var(--gray-700);
}

/* ========== Table Component ========== */
.table-container {
    background: var(--white);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-lg);
    overflow: hidden;
}

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

thead {
    background: var(--gray-50);
    border-bottom: 1px solid var(--gray-200);
}

th {
    text-align: left;
    padding: 12px 16px;
    font-size: 12px;
    font-weight: 600;
    color: var(--gray-700);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

td {
    padding: 16px;
    font-size: 14px;
    color: var(--gray-900);
    border-bottom: 1px solid var(--gray-200);
}

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

tbody tr:hover {
    background: var(--gray-50);
}

/* ========== Modal ========== */
.modal {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.4);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    opacity: 0;
    visibility: hidden;
    transition: all var(--transition-base);
}

.modal.active {
    opacity: 1;
    visibility: visible;
}

.modal-content {
    background: var(--white);
    border-radius: var(--radius-xl);
    max-width: 600px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: var(--shadow-xl);
    transform: scale(0.95);
    transition: transform var(--transition-base);
}

.modal.active .modal-content {
    transform: scale(1);
}

/* ========== Form Group ========== */
.form-group {
    margin-bottom: 20px;
}

.form-label {
    display: block;
    font-size: 13px;
    font-weight: 500;
    color: var(--gray-700);
    margin-bottom: 8px;
}

.form-hint {
    font-size: 12px;
    color: var(--gray-600);
    margin-top: 6px;
}

/* ========== Divider ========== */
.divider {
    height: 1px;
    background: var(--gray-200);
    margin: 24px 0;
}

/* ========== Animations ========== */
@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

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

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.anim-fade-in {
    animation: fadeIn 0.5s ease;
}

.anim-slide-up {
    animation: slideUp 0.5s ease;
}

.anim-slide-down {
    animation: slideDown 0.5s ease;
}

/* ========== Utility Classes ========== */
.text-center {
    text-align: center;
}

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

.flex {
    display: flex;
}

.flex-col {
    flex-direction: column;
}

.items-center {
    align-items: center;
}

.justify-center {
    justify-content: center;
}

.justify-between {
    justify-content: space-between;
}

.gap-8 {
    gap: 8px;
}

.gap-16 {
    gap: 16px;
}

.gap-24 {
    gap: 24px;
}

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

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

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

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

/* ========== Responsive ========== */
@media (max-width: 1024px) {
    .nav-menu {
        position: fixed;
        top: 64px;
        left: 0;
        right: 0;
        background: var(--white);
        flex-direction: column;
        gap: 0;
        padding: 16px;
        border-bottom: 1px solid var(--gray-200);
        transform: translateY(-100%);
        transition: transform var(--transition-base);
    }
    
    .nav-menu.active {
        transform: translateY(0);
    }
    
    .nav-link {
        width: 100%;
        justify-content: flex-start;
        padding: 12px 16px;
    }
    
    .nav-mobile-toggle {
        display: flex;
    }
    
    .grid-cols-2,
    .grid-cols-3,
    .grid-cols-4 {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .top-nav {
        padding: 0 16px;
    }
    
    .container {
        padding: 24px 16px;
    }
    
    .page-title {
        font-size: 24px;
    }
    
    .stat-value {
        font-size: 24px;
    }
    
    .nav-balance {
        display: none;
    }
}

/* ========== Print Styles ========== */
@media print {
    .top-nav,
    .nav-actions,
    .btn {
        display: none !important;
    }
}

