/* ---------------------------------------------------------
   GLOBAL
--------------------------------------------------------- */
body {
    margin: 0;
    padding: 0;
    font-family: Arial, sans-serif;
    background: #f5f5f5;
    color: #222;
}

body.dark {
    background: #0d0d0d;
    color: #e0e0e0;
}

/* ---------------------------------------------------------
   HEADER
--------------------------------------------------------- */
header {
    background: #fff;
    padding: 20px;
    border-bottom: 2px solid #00c46b;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.title {
    font-size: 1.4rem;
    font-weight: bold;
    color: #00c46b;
}

.subtitle {
    font-size: 0.9rem;
    margin-top: 4px;
}

.balance-box {
    margin-top: 10px;
    font-size: 0.9rem;
}

.logo {
    width: 48px;
    height: 48px;
}

/* ---------------------------------------------------------
   BUTTONS
--------------------------------------------------------- */
button {
    cursor: pointer;
    border: none;
    padding: 8px 14px;
    border-radius: 4px;
    font-size: 0.9rem;
}

.btn-primary {
    background: #00c46b;
    color: #000;
}

.btn-secondary {
    background: #333;
    color: #00c46b;
    border: 1px solid #00c46b;
}

.btn-danger {
    background: #c40000;
    color: #fff;
}

.small-btn {
    padding: 6px 10px;
    font-size: 0.8rem;
}

/* ---------------------------------------------------------
   TABS
--------------------------------------------------------- */
.tabs {
    display: flex;
    gap: 10px;
    padding: 10px;
    background: #eee;
    border-bottom: 2px solid #00c46b;
}

.tab-btn {
    background: #ddd;
    color: #333;
    border: 1px solid #ccc;
}

.tab-btn.active {
    background: #00c46b;
    color: #000;
}

/* DARK MODE TABS */
body.dark .tabs {
    background: #111;
}

body.dark .tab-btn {
    background: #222;
    color: #ccc;
    border-color: #333;
}

body.dark .tab-btn.active {
    background: #00c46b;
    color: #000;
}

/* ---------------------------------------------------------
   TAB CONTENT
--------------------------------------------------------- */
.tab-content {
    display: none;
    padding: 20px;
}

.tab-content.active {
    display: block;
}

/* ---------------------------------------------------------
   CARD (LIGHT MODE)
--------------------------------------------------------- */
.card {
    background: #fff;
    color: #000;
    padding: 20px;
    border-radius: 6px;
    border: 1px solid #ccc;
    margin-bottom: 20px;
}

/* DARK MODE CARD */
body.dark .card {
    background: #111;
    color: #eee;
    border-color: #00c46b;
}

/* ---------------------------------------------------------
   GRID SYSTEM
--------------------------------------------------------- */
.grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.grid-3 {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 12px;
}

.card input,
.card select {
    width: 100%;
    padding: 8px;
    border-radius: 4px;
    border: 1px solid #ccc;
}

body.dark .card input,
body.dark .card select {
    background: #222;
    color: #eee;
    border-color: #00c46b;
}

/* ---------------------------------------------------------
   LEDGER TABLE
--------------------------------------------------------- */
.ledger-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
}

.ledger-table th {
    background: #00c46b;
    color: #000;
    padding: 10px;
}

.ledger-table td {
    padding: 10px;
    border: 1px solid #ccc;
}

body.dark .ledger-table td {
    border-color: #333;
}

/* ---------------------------------------------------------
   RECEIPT THUMBNAILS
--------------------------------------------------------- */
.receipt-thumbs {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.receipt-thumb-wrapper {
    position: relative;
}

.receipt-thumb {
    width: 45px;
    height: 45px;
    object-fit: cover;
    border-radius: 4px;
    border: 2px solid #00c46b;
    cursor: pointer;
}

.receipt-thumb-wrapper .btn-danger {
    position: absolute;
    top: -6px;
    right: -6px;
    padding: 2px 4px;
    font-size: 0.6rem;
    border-radius: 50%;
}

/* ---------------------------------------------------------
   VIEW BUTTON
--------------------------------------------------------- */
.view-btn {
    background: #00c46b;
    color: #000;
    padding: 6px 10px;
    border-radius: 4px;
    font-size: 0.8rem;
}

/* ---------------------------------------------------------
   SLIDE-IN VIEWER (OVERLAY)
--------------------------------------------------------- */
.viewer-panel {
    position: fixed;
    top: 0;
    right: -500px;
    width: 500px;
    height: 100%;
    background: #0d0d0d;
    border-left: 3px solid #00c46b;
    box-shadow: -4px 0 10px rgba(0,0,0,0.6);
    transition: right 0.35s ease;
    z-index: 9999;
    display: flex;
    flex-direction: column;
}

.viewer-panel.open {
    right: 0;
}

.viewer-header {
    background: #00c46b;
    color: #000;
    padding: 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.viewer-content {
    padding: 20px;
    overflow-y: auto;
}

.viewer-receipts img {
    width: 100%;
    border-radius: 6px;
    border: 2px solid #00c46b;
    margin-bottom: 10px;
}
