:root {
    --bg-color: #f4f6f8;
    --text-primary: #1e293b;
    --text-secondary: #64748b;
    --accent-color: #107c41;
    --accent-hover: #0e703a;
    --glass-bg: rgba(255, 255, 255, 0.95);
    --glass-border: rgba(0, 0, 0, 0.05);
    --glass-shadow: 0 8px 30px rgba(0, 0, 0, 0.05);
    --success-color: #107c41;
    --danger-color: #ef4444;
}

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

body {
    font-family: 'Outfit', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-primary);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    overflow-x: hidden;
    position: relative;
}

.app-container {
    width: fit-content;
    max-width: 100vw;
    min-width: 320px;
    margin: 0 auto;
    height: 100vh;
    display: flex;
    flex-direction: column;
    position: relative;
    z-index: 10;
}

.app-header {
    padding: 1.5rem 1.5rem 1rem;
    text-align: center;
    animation: fadeInDown 0.8s ease forwards;
}

.app-header h1 {
    font-size: 2rem;
    font-weight: 700;
    color: var(--accent-color);
    margin-bottom: 0.25rem;
}

.classic-title {
    font-family: 'Georgia', 'Times New Roman', serif;
    letter-spacing: 2px;
    text-transform: uppercase;
    font-weight: bold;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.1);
}

.app-header p {
    color: var(--text-secondary);
    font-size: 0.9rem;
    font-weight: 400;
}

.app-main {
    flex: 1;
    padding: 0 1rem 1.5rem 1rem;
    overflow-y: auto;
    overflow-x: hidden;
}

.tab-content {
    display: none;
    animation: fadeInUp 0.4s ease forwards;
}

.tab-content.active {
    display: block;
}

.hidden {
    display: none !important;
}

.glass-card {
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    padding: 1.5rem;
    box-shadow: var(--glass-shadow);
}

.mb-4 { margin-bottom: 1.5rem; }
.mt-3 { margin-top: 1rem; }
.mt-4 { margin-top: 1.5rem; }

h3 {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

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

.input-group {
    margin-bottom: 1rem;
}

.form-compact .input-group {
    margin-bottom: 0.6rem;
}

.form-compact label {
    margin-bottom: 0.2rem;
}

.input-group label {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--text-secondary);
}

.row {
    display: flex;
    gap: 1rem;
}

.col {
    flex: 1;
}

input, select {
    width: 100%;
    appearance: none;
    background: #ffffff;
    border: 1px solid #cbd5e1;
    border-radius: 10px;
    padding: 0.6rem 0.8rem;
    color: var(--text-primary);
    font-size: 0.9rem;
    font-family: 'Outfit', sans-serif;
    outline: none;
    transition: all 0.3s ease;
}

input::placeholder {
    color: #94a3b8;
}

input:focus, select:focus {
    border-color: var(--accent-color);
    box-shadow: 0 0 0 2px rgba(16, 124, 65, 0.2);
}

select option {
    background-color: #ffffff;
    color: var(--text-primary);
}

.custom-select-wrapper {
    position: relative;
}

.custom-arrow {
    position: absolute;
    top: 50%;
    right: 1rem;
    transform: translateY(-50%);
    width: 0;
    height: 0;
    border-left: 5px solid transparent;
    border-right: 5px solid transparent;
    border-top: 5px solid var(--text-secondary);
    pointer-events: none;
    transition: transform 0.3s ease;
}

select:focus + .custom-arrow {
    transform: translateY(-50%) rotate(180deg);
}

.btn-primary {
    width: 100%;
    background: var(--accent-color);
    color: white;
    border: none;
    border-radius: 12px;
    padding: 0.9rem;
    font-size: 1rem;
    font-weight: 600;
    font-family: 'Outfit', sans-serif;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 0.5rem;
}

.btn-primary:hover {
    background: var(--accent-hover);
}

.btn-primary:active {
    transform: translateY(2px);
}

.btn-compact {
    padding: 0.6rem;
    font-size: 0.95rem;
    margin-top: 0.2rem;
}

.btn-secondary {
    background: #f1f5f9;
    color: var(--text-primary);
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 0.8rem 1.5rem;
    font-size: 0.95rem;
    font-weight: 600;
    font-family: 'Outfit', sans-serif;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-secondary:hover {
    background: #e2e8f0;
}

.btn-text {
    background: transparent;
    color: var(--danger-color);
    border: none;
    font-size: 0.85rem;
    font-weight: 600;
    font-family: 'Outfit', sans-serif;
    cursor: pointer;
}

.btn-text:hover {
    text-decoration: underline;
}

/* Tenant Info */
.tenant-info {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 1rem;
    margin-bottom: 1.2rem;
    animation: fadeInDown 0.4s ease forwards;
}

.info-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.4rem;
    font-size: 0.85rem;
}

.info-row span { color: var(--text-secondary); }
.info-row strong { color: var(--text-primary); font-weight: 600; }

.tagihan-row {
    margin-top: 0.6rem;
    padding-top: 0.6rem;
    border-top: 1px dashed #cbd5e1;
}
.tagihan-row strong {
    color: var(--accent-color);
    font-size: 1.05rem;
}

/* Table / Excel-like styling */
.table-responsive {
    width: 100%;
    overflow-x: auto;
    margin-top: 1rem;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.excel-table {
    width: max-content;
    margin: 0 auto;
    border-collapse: collapse;
    font-family: 'Calibri', 'Arial', sans-serif;
    font-size: 0.85rem;
    text-align: left;
    white-space: nowrap;
    background-color: #ffffff;
}

.excel-table th, .excel-table td {
    padding: 0.4rem 0.6rem;
    border: 1px solid #d4d4d4;
}

.excel-table th {
    background: #107c41; /* Microsoft Excel Green */
    color: #ffffff;
    font-weight: 600;
    border: 1px solid #0e703a;
}

.excel-table tbody tr {
    background: #ffffff;
}

.excel-table tbody tr:nth-child(even) {
    background: #f9f9f9;
}

.excel-table tbody tr:hover {
    background: #e5f3ff; /* Light blue Excel hover */
}

.excel-table td {
    color: #000000;
}

.excel-table td strong {
    color: #107c41;
}

.excel-table .action-col {
    text-align: center;
}

.excel-table td .btn-text {
    font-size: 0.8rem;
    font-weight: 600;
}

.form-excel {
    width: 100%;
    min-width: 100%;
    margin-bottom: 1rem;
}

.form-excel td.label-cell {
    background-color: #f3f2f1;
    font-weight: 600;
    width: 35%;
    color: #323130;
    border: 1px solid #d4d4d4;
}

.form-excel td.input-cell {
    padding: 0;
    border: 1px solid #d4d4d4;
    background: #ffffff;
}

.form-excel input, .form-excel select {
    width: 100%;
    height: 100%;
    border: none;
    border-radius: 0;
    padding: 0.6rem 0.8rem;
    margin: 0;
    box-shadow: none !important;
    background: transparent;
    font-family: 'Calibri', 'Arial', sans-serif;
    outline: none;
    color: #000;
}

.form-excel input:focus, .form-excel select:focus {
    box-shadow: inset 0 0 0 2px #107c41 !important;
}

.badge {
    display: inline-block;
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: 600;
    background: rgba(16, 185, 129, 0.2);
    color: var(--success-color);
}

.badge-danger {
    background: rgba(239, 68, 68, 0.2);
    color: var(--error-color);
}

.empty-state {
    text-align: center;
    padding: 2rem 0;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

/* Recap Cards */
.recap-cards {
    display: flex;
    gap: 1rem;
}

.recap-card {
    flex: 1;
    padding: 0.8rem;
    text-align: center;
}

.recap-label {
    display: block;
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-bottom: 0.25rem;
    font-weight: 600;
}

.recap-value {
    display: block;
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--success-color);
}

/* Success Message */
.success-message {
    text-align: center;
    margin-top: 1rem;
}

.success-icon {
    width: 60px;
    height: 60px;
    background: var(--success-color);
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 1.8rem;
    color: white;
    margin: 0 auto 1rem;
    box-shadow: 0 0 20px rgba(16, 185, 129, 0.4);
}

.success-message h2 {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
}

.success-message p {
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
    line-height: 1.5;
    font-size: 0.9rem;
}

/* Top Navigation */
.top-nav {
    width: calc(100% - 2rem);
    height: 60px;
    background: transparent;
    border: none;
    box-shadow: none;
    display: flex;
    justify-content: flex-start;
    align-items: flex-end;
    padding: 0;
    z-index: 50;
    margin: 0 auto 0 auto;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    gap: 0.2rem;
}

.nav-btn {
    background: rgba(255, 255, 255, 0.6);
    border: 1px solid var(--glass-border);
    border-bottom: none;
    border-radius: 12px 12px 0 0;
    color: var(--text-secondary);
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    cursor: pointer;
    transition: all 0.3s ease;
    flex: 1;
    height: 45px;
}

.nav-btn svg {
    width: 18px;
    height: 18px;
    transition: all 0.3s ease;
}

.nav-btn span {
    font-size: 0.8rem;
    font-family: 'Outfit', sans-serif;
    font-weight: 500;
}

.nav-btn.active {
    color: #ffffff;
    height: 48px;
    box-shadow: 0 -4px 10px rgba(0,0,0,0.05);
}

.nav-btn[data-target="tab-harta"].active {
    background: #10b981;
    border-color: #10b981;
}

.nav-btn[data-target="tab-datapenghuni"].active {
    background: #3b82f6;
    border-color: #3b82f6;
}

.nav-btn[data-target="tab-laporan"].active {
    background: #f59e0b;
    border-color: #f59e0b;
}

.nav-btn[data-target="tab-tagihan"].active {
    background: #ef4444;
    border-color: #ef4444;
}

.nav-btn.active svg {
    transform: none;
    filter: none;
}

/* Ambient Lights */
.ambient-light {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    z-index: 1;
    opacity: 0.15;
}

.light-1 {
    width: 250px;
    height: 250px;
    background: #10b981;
    top: -50px;
    right: -50px;
}

.light-2 {
    width: 200px;
    height: 200px;
    background: #3b82f6;
    bottom: 50px;
    left: -50px;
}

/* Animations */
@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}
@keyframes fadeInDown {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Modal */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.4);
    z-index: 1000;
    display: flex;
    justify-content: center;
    align-items: center;
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}
.modal-content {
    background: var(--bg-color);
    width: 95%;
    max-width: 440px;
    border-radius: 20px;
    padding: 1.5rem;
    box-shadow: 0 10px 40px rgba(0,0,0,0.2);
    max-height: 90vh;
    overflow-y: auto;
}
