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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: #f0fdf4;
    color: #1e293b;
    min-height: 100vh;
}

a {
    color: inherit;
    text-decoration: none;
}

/* ===== HEADER ===== */
.header {
    background: linear-gradient(135deg, #16a34a 0%, #22c55e 100%);
    border-bottom: 2px solid #15803d;
    padding: 1.2rem 2rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.header h1 {
    font-size: 1.5rem;
    font-weight: 700;
    color: #ffffff;
}

.header-actions {
    display: flex;
    gap: 0.75rem;
    align-items: center;
}

/* ===== CONTAINER & LAYOUT ===== */
.container {
    max-width: 1500px;
    margin: 0 auto;
    padding: 1.5rem;
}

.grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

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

/* ===== TABS ===== */
.tabs {
    display: flex;
    gap: 0.4rem;
    margin-bottom: 1rem;
    border-bottom: 1px solid #dcfce7;
    padding-bottom: 0;
}

.tab {
    padding: 0.6rem 1.2rem;
    font-size: 0.82rem;
    font-weight: 500;
    color: #94a3b8;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    transition: all 0.2s;
    background: none;
    border-top: none;
    border-left: none;
    border-right: none;
    font-family: 'Inter', sans-serif;
}

.tab:hover {
    color: #16a34a;
}

.tab.active {
    color: #16a34a;
    border-bottom-color: #22c55e;
}

/* ===== CARDS ===== */
.card {
    background: #ffffff;
    border: 1px solid #dcfce7;
    border-radius: 14px;
    padding: 1.5rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.card:hover {
    border-color: #86efac;
    box-shadow: 0 4px 16px rgba(22, 163, 74, 0.1);
}

.card-title {
    font-size: 1rem;
    font-weight: 600;
    color: #16a34a;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.card-title .icon {
    font-size: 1.2rem;
}

.auth-card {
    background: #ffffff;
    border: 1px solid #dcfce7;
    border-radius: 14px;
    padding: 1.5rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.notice-card {
    background: #f0fdf4;
    border: 1px solid #dcfce7;
    border-radius: 14px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

.narrow {
    max-width: 600px;
}

h2,
h3 {
    color: #16a34a;
    margin: 0 0 1rem;
}

/* ===== FORMS ===== */
.stack {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.form-group {
    margin-bottom: 0.85rem;
}

.form-group label {
    display: block;
    font-size: 0.78rem;
    font-weight: 500;
    color: #64748b;
    margin-bottom: 0.3rem;
}

.form-row {
    display: flex;
    gap: 0.75rem;
}

.form-row .form-group {
    flex: 1;
}

input[type="text"],
input[type="number"],
input[type="password"] {
    width: 100%;
    padding: 0.55rem 0.85rem;
    background: #ffffff;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    color: #1e293b;
    font-family: 'Inter', sans-serif;
    font-size: 0.85rem;
    transition: border-color 0.2s;
}

input:focus {
    outline: none;
    border-color: #22c55e;
    box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.15);
}

textarea {
    width: 100%;
    padding: 0.55rem 0.85rem;
    background: #ffffff;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    color: #1e293b;
    font-family: 'Inter', monospace;
    font-size: 0.82rem;
    resize: vertical;
    line-height: 1.6;
}

textarea:focus {
    outline: none;
    border-color: #22c55e;
    box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.15);
}

/* ===== BUTTONS ===== */
.btn {
    padding: 0.55rem 1.2rem;
    border: none;
    border-radius: 8px;
    font-family: 'Inter', sans-serif;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.btn:hover {
    transform: translateY(-1px);
}

.btn:active {
    transform: translateY(0);
}

.btn-primary {
    background: linear-gradient(135deg, #16a34a, #22c55e);
    color: #fff;
}

.btn-primary:hover {
    box-shadow: 0 4px 15px rgba(22, 163, 74, 0.4);
}

.btn-success {
    background: linear-gradient(135deg, #16a34a, #22c55e);
    color: #fff;
}

.btn-success:hover {
    box-shadow: 0 4px 15px rgba(22, 163, 74, 0.4);
}

.btn-danger {
    background: linear-gradient(135deg, #dc2626, #ef4444);
    color: #fff;
}

.btn-danger:hover {
    box-shadow: 0 4px 15px rgba(220, 38, 38, 0.4);
}

.btn-warning {
    background: linear-gradient(135deg, #f59e0b, #fbbf24);
    color: #1a1a2e;
}

.btn-warning:hover {
    box-shadow: 0 4px 15px rgba(245, 158, 11, 0.4);
}

.btn-sm {
    padding: 0.35rem 0.75rem;
    font-size: 0.78rem;
    border-radius: 6px;
}

.btn-outline {
    background: transparent;
    border: 1px solid rgba(22, 163, 74, 0.5);
    color: #16a34a;
}

.btn-outline:hover {
    background: rgba(22, 163, 74, 0.08);
}

.btn-outline.light {
    border-color: rgba(255, 255, 255, 0.5);
    color: #fff;
}

/* ===== ALERTS ===== */
.alert {
    border-radius: 10px;
    margin-bottom: 1rem;
    padding: 0.75rem 1.25rem;
    font-size: 0.85rem;
    font-weight: 500;
}

.alert-success {
    background: rgba(22, 163, 74, 0.12);
    border: 1px solid rgba(22, 163, 74, 0.3);
    color: #15803d;
}

.alert-error {
    background: rgba(239, 68, 68, 0.12);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: #b91c1c;
}

.alert-warning {
    background: rgba(217, 119, 6, 0.12);
    border: 1px solid rgba(217, 119, 6, 0.3);
    color: #92400e;
}

/* ===== UPLOAD ZONE ===== */
.upload-zone {
    border: 2px dashed rgba(22, 163, 74, 0.35);
    border-radius: 12px;
    padding: 2rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    background: rgba(22, 163, 74, 0.03);
}

.upload-zone:hover,
.upload-zone.dragover {
    border-color: #16a34a;
    background: rgba(22, 163, 74, 0.08);
}

.upload-zone .icon {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
    display: block;
}

.upload-zone p {
    color: #64748b;
    font-size: 0.85rem;
    margin: 0;
}

.upload-zone .sub {
    font-size: 0.75rem;
    color: #94a3b8;
    margin-top: 0.3rem;
    display: block;
}

.upload-zone input[type="file"] {
    position: absolute;
    inset: 0;
    opacity: 0;
    cursor: pointer;
}

/* ===== OCR RESULT ===== */
.ocr-result {
    margin-top: 1rem;
    padding: 1rem;
    background: #f8fafc;
    border-radius: 10px;
    border: 1px solid #e2e8f0;
    display: none;
}

.ocr-result.show {
    display: block;
    animation: fadeIn 0.3s ease;
}

.ocr-result h4 {
    font-size: 0.85rem;
    color: #16a34a;
    margin-bottom: 0.5rem;
}

.ocr-result pre {
    font-size: 0.8rem;
    color: #64748b;
    white-space: pre-wrap;
    word-break: break-word;
    max-height: 120px;
    overflow-y: auto;
    margin: 0;
}

.result-line {
    display: flex;
    justify-content: space-between;
    padding: 0.5rem 0;
    border-bottom: 1px solid #e2e8f0;
    font-size: 0.82rem;
}

/* ===== TABLES ===== */
.table-wrap {
    overflow-x: auto;
    border-radius: 14px;
    border: 1px solid #dcfce7;
    background: #ffffff;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

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

thead {
    background: linear-gradient(135deg, #f0fdf4, #dcfce7);
}

th {
    padding: 0.85rem 1rem;
    text-align: left;
    font-size: 0.78rem;
    font-weight: 600;
    color: #15803d;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    white-space: nowrap;
}

td {
    padding: 0.75rem 1rem;
    font-size: 0.85rem;
    border-top: 1px solid #f1f5f9;
    white-space: nowrap;
    color: #334155;
}

tbody tr {
    transition: background 0.15s;
}

tbody tr:hover {
    background: #f0fdf4;
}

.actions-cell {
    display: flex;
    gap: 0.4rem;
}

.low-row {
    background: rgba(239, 68, 68, 0.06);
}

/* ===== EMPTY STATE ===== */
.empty-state {
    text-align: center;
    padding: 3rem 1rem;
    color: #94a3b8;
}

.empty-state .icon {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
    display: block;
}

/* ===== STATS GRID ===== */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.stat-card {
    background: #ffffff;
    border: 1px solid #dcfce7;
    border-radius: 14px;
    padding: 1.25rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
    transition: all 0.3s ease;
}

.stat-card:hover {
    border-color: #86efac;
    box-shadow: 0 4px 16px rgba(22, 163, 74, 0.12);
    transform: translateY(-2px);
}

.stat-card .stat-icon {
    font-size: 1.5rem;
    margin-bottom: 0.4rem;
}

.stat-card .stat-label {
    font-size: 0.75rem;
    font-weight: 500;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.stat-card .stat-value {
    font-size: 1.6rem;
    font-weight: 700;
    color: #1e293b;
    margin-top: 0.2rem;
}

.stat-card.profit-positive .stat-value {
    color: #16a34a;
}

.stat-card.profit-negative .stat-value {
    color: #ef4444;
}

/* ===== BADGES ===== */
.badge {
    display: inline-block;
    padding: 0.15rem 0.55rem;
    border-radius: 20px;
    font-size: 0.72rem;
    font-weight: 600;
}

.badge-in {
    background: rgba(22, 163, 74, 0.12);
    color: #16a34a;
}

.badge-out {
    background: rgba(239, 68, 68, 0.12);
    color: #ef4444;
}

/* ===== LANDING PAGE ===== */
.landing-wrapper {
    display: flex;
    min-height: 100vh;
    background: linear-gradient(135deg, #f0fdf4 0%, #dcfce7 100%);
}

.landing-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 4rem;
}

.landing-title {
    font-size: 3.5rem;
    font-weight: 800;
    color: #16a34a;
    line-height: 1.1;
    margin-bottom: 1rem;
    letter-spacing: -0.02em;
}

.landing-subtitle {
    font-size: 1.25rem;
    color: #475569;
    margin-bottom: 2.5rem;
    max-width: 500px;
    line-height: 1.6;
}

.landing-features {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    max-width: 600px;
}

.feature-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.95rem;
    font-weight: 500;
    color: #334155;
    background: rgba(255, 255, 255, 0.6);
    padding: 0.75rem 1rem;
    border-radius: 10px;
    border: 1px solid rgba(22, 163, 74, 0.1);
}

/* ===== AUTH SIDEBAR ===== */
.auth-sidebar {
    width: 450px;
    background: #ffffff;
    box-shadow: -10px 0 40px rgba(0, 0, 0, 0.05);
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 3rem;
}

.login-layout {
    display: grid;
    grid-template-columns: 1fr 450px;
    min-height: 100vh;
}

.login-body {
    background: linear-gradient(135deg, #f0fdf4 0%, #dcfce7 100%);
}

@media (max-width: 900px) {
    .landing-wrapper {
        flex-direction: column;
    }

    .landing-content {
        padding: 2rem;
        align-items: center;
        text-align: center;
    }

    .landing-subtitle {
        margin-left: auto;
        margin-right: auto;
    }

    .auth-sidebar {
        width: 100%;
        padding: 2rem;
        box-shadow: none;
    }

    .login-layout {
        grid-template-columns: 1fr;
    }
}

/* ===== ANIMATIONS ===== */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

@keyframes fadeOut {
    to {
        opacity: 0;
        transform: translateY(-10px);
    }
}

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

/* ===== MISCELLANEOUS ===== */
.muted {
    color: #94a3b8;
    font-size: 0.82rem;
}

pre {
    color: #64748b;
    font-family: Consolas, monospace;
    white-space: pre-wrap;
    word-break: break-word;
}

.ai-form {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.ai-form input {
    flex: 1;
}

.filter-row {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .landing-title {
        font-size: 2.5rem;
    }

    .header {
        padding: 1rem;
    }

    .header h1 {
        font-size: 1.2rem;
    }

    .container {
        padding: 1rem;
    }

    .auth-sidebar {
        width: 100%;
    }
}

@media (max-width: 900px) {
    .login-layout,
    .landing-wrapper { flex-direction: column; }
    .landing-content { padding: 2rem; align-items: center; text-align: center; }
    .landing-subtitle { margin-left: auto; margin-right: auto; }
    .auth-sidebar { width: 100%; padding: 2rem; }
    .ai-form { flex-direction: column; }
}

/* White/green theme overrides to match the original app direction. */
body {
    background: #f4fbf6;
    color: #102115;
}

.header {
    background: #ffffff;
    border-bottom: 2px solid #22c55e;
    box-shadow: 0 2px 16px rgba(15, 118, 65, 0.08);
}

.header h1,
.header-actions span {
    color: #12351f !important;
}

.container {
    background: #f4fbf6;
}

.tabs {
    border-bottom-color: #cfe8d6;
}

.tab {
    color: #607468;
}

.tab:hover,
.tab.active {
    color: #15803d;
    border-bottom-color: #22c55e;
}

.card,
.stat-card,
.table-wrap,
.notice-card {
    background: #ffffff;
    border-color: #d8eadc;
    box-shadow: 0 6px 20px rgba(15, 118, 65, 0.08);
}

.card:hover,
.stat-card:hover {
    border-color: #86efac;
    box-shadow: 0 10px 28px rgba(15, 118, 65, 0.12);
}

.card-title,
h2,
h3,
.ocr-result h4 {
    color: #15803d;
}

.form-group label,
label,
.muted,
.stat-card .stat-label,
.landing-subtitle {
    color: #617567;
}

input[type="text"],
input[type="number"],
input[type="password"],
textarea {
    background: #f8fff9;
    border-color: #cfe8d6;
    color: #102115;
}

input:focus,
textarea:focus {
    border-color: #22c55e;
    box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.18);
}

.btn-primary,
.btn-success,
.alert-success {
    background: linear-gradient(135deg, #16a34a, #22c55e);
    color: #ffffff;
}

.btn-primary:hover,
.btn-success:hover {
    box-shadow: 0 4px 15px rgba(34, 197, 94, 0.35);
}

.btn-outline {
    border-color: rgba(22, 163, 74, 0.5);
    color: #15803d;
}

.btn-outline:hover {
    background: rgba(34, 197, 94, 0.09);
}

.btn-outline.light {
    border-color: rgba(22, 163, 74, 0.5);
    color: #15803d;
}

thead {
    background: #ecfdf3;
}

th {
    color: #15803d;
}

td {
    border-top-color: #e0efe4;
    color: #26382c;
}

tbody tr:hover {
    background: #f0fdf4;
}

.low-row {
    background: #fff7ed;
}

.empty-state {
    color: #6b7d70;
}

.empty-state .icon,
.stat-card .stat-icon,
.upload-zone .icon {
    color: #22c55e;
}

.badge-in {
    background: rgba(34, 197, 94, 0.16);
    color: #15803d;
}

.badge-out {
    background: rgba(239, 68, 68, 0.12);
    color: #dc2626;
}

.stat-card .stat-value {
    color: #102115;
}

.positive,
.stat-card.profit-positive .stat-value {
    color: #16a34a;
}

.negative,
.stat-card.profit-negative .stat-value {
    color: #dc2626;
}

.login-layout,
.landing-wrapper {
    background: linear-gradient(135deg, #f5fff7 0%, #e8f8ed 100%);
}

.landing-title {
    color: #15803d;
}

.feature-item {
    background: rgba(255, 255, 255, 0.82);
    border-color: rgba(34, 197, 94, 0.22);
    color: #1f3326;
}

.auth-sidebar {
    background: #ffffff;
    box-shadow: -10px 0 40px rgba(15, 118, 65, 0.12);
}

.upload-zone {
    background: rgba(34, 197, 94, 0.06);
    border-color: rgba(34, 197, 94, 0.36);
}

.upload-zone:hover,
.upload-zone.dragover {
    border-color: #22c55e;
    background: rgba(34, 197, 94, 0.11);
}

.upload-zone p {
    color: #304a38;
}

.upload-zone .sub {
    color: #789182;
}

.ocr-result {
    background: #f8fff9;
    border-color: #d8eadc;
}

.ocr-result pre,
pre {
    color: #506258;
}

.alert-error {
    background: linear-gradient(135deg, #dc2626, #ef4444);
    color: #ffffff;
}

.alert-warning {
    background: #fff7ed;
    border-color: #fed7aa;
    color: #9a3412;
}
