:root {
    --bg-color: #f4fafe;
    --surface-color: #ffffff;
    --text-primary: #1e3a5f;
    --text-secondary: #5e81ac;
    --accent-color: #00b4d8;
    --glow-color: #00d2ff;
    --sunset-glow: #fb8500;
    --border-color: #baddf9;
    --danger-color: #e63946;
    color-scheme: light; 
}

[data-theme="dark"] {
    --bg-color: #0d1b2a;
    --surface-color: #1b263b;
    --text-primary: #ffffff; 
    --text-secondary: #a0b8d6; 
    --accent-color: #60a5fa;
    --glow-color: #00e5ff; 
    --sunset-glow: #ffb703;
    --border-color: #2c3e50;
    color-scheme: dark; 
}

* { margin: 0; padding: 0; box-sizing: border-box; font-family: 'Nunito', sans-serif; transition: background-color 0.3s, color 0.3s, border-color 0.3s, box-shadow 0.3s; }

body {
    background-color: var(--bg-color); color: var(--text-primary);
    display: flex; flex-direction: column; align-items: center;
    min-height: 100vh; padding-bottom: 50px; 
    font-size: 11px; /* DIPERKECIL: sebelumnya 13px */
}

.app-container { width: 100vw; max-width: 700px; padding: 0 5px; }

/* Header presisi dengan Glow Tebal */
.app-header {
    margin: 10px 0; padding-bottom: 10px;
    border-bottom: 2px solid var(--glow-color); 
    box-shadow: 0 4px 10px -4px rgba(0, 210, 255, 0.5); 
}
.header-top, .header-bottom { display: flex; justify-content: space-between; align-items: center; }
.header-bottom { margin-top: 10px; }

h1 { font-size: 1.25rem; /* DIPERKECIL: sebelumnya 1.5rem */ font-weight: 700; color: var(--accent-color); text-shadow: 0 0 8px rgba(0, 180, 216, 0.6); letter-spacing: 1px; }

.icon-btn, .clean-input { background: transparent; border: none; color: var(--text-primary); outline: none; cursor: pointer; font-weight: 700;}
.icon-btn { font-size: 1.1rem; /* DIPERKECIL: sebelumnya 1.3rem */ }

.clean-input option { background-color: var(--surface-color); color: var(--text-primary); }

.profile-section { display: flex; align-items: center; gap: 5px; font-weight: 600; color: var(--text-secondary); }

.add-btn { background: var(--sunset-glow); color: #fff; border: none; padding: 5px 12px; border-radius: 15px; font-weight: 700; font-size: 0.7rem; /* DIPERKECIL: sebelumnya 0.8rem */ cursor: pointer; box-shadow: 0 2px 5px rgba(251, 133, 0, 0.3); }

/* Tabel Presisi dengan Efek GARIS MENYALA LEBIH TEBAL */
.table-wrapper { width: 100%; overflow-x: hidden; border-radius: 8px; margin-bottom: 15px; }
.cycle-table { 
    width: 100%; border-collapse: collapse; background: var(--surface-color); table-layout: fixed; 
    border: 2px solid var(--glow-color); 
    box-shadow: 0 0 25px rgba(0, 210, 255, 0.4); 
}

.cycle-table th, .cycle-table td {
    border: 2px solid var(--glow-color); 
    box-shadow: inset 0 0 10px rgba(0, 210, 255, 0.2); 
    padding: 6px 2px; text-align: center; vertical-align: middle;
    white-space: nowrap; overflow: hidden; 
    font-size: 11px; /* DIPERKECIL: sebelumnya 13px */
}

.cycle-table th { background: rgba(0, 180, 216, 0.15); color: var(--text-secondary); font-size: 0.7rem; /* DIPERKECIL: sebelumnya 0.8rem */ font-weight: 800; }

/* Lebar Proporsional 100vw HP */
.cycle-table th:nth-child(1), .cycle-table td:nth-child(1) { width: 30%; } 
.cycle-table th:nth-child(2), .cycle-table td:nth-child(2) { width: 30%; } 

/* Khusus Kolom Catatan agar bisa text wrap */
.cycle-table th:nth-child(3), .cycle-table td:nth-child(3) { 
    width: 22%; 
    white-space: normal; 
    word-break: break-word; 
    vertical-align: top;
}

.cycle-table th:nth-child(4), .cycle-table td:nth-child(4) { width: 25%; } 
.cycle-table th:nth-child(5), .cycle-table td:nth-child(5) { width: 10%; }  

/* Input & Textarea di dalam Data */
.cycle-table input, .cycle-table textarea {
    width: 100%; border: none; background: transparent; color: var(--text-primary);
    text-align: center; font-size: 11px; /* DIPERKECIL: sebelumnya 13px */ font-family: inherit; outline: none;
}
.cycle-table textarea {
    resize: none; 
    min-height: 30px; /* Diperkecil menyesuaikan font */
    padding-top: 8px;
    overflow: hidden; 
}
.cycle-table input:focus, .cycle-table textarea:focus { background: rgba(0, 180, 216, 0.1); }
.est-date { color: var(--accent-color); font-weight: 800; }

.icon-action-btn { background: transparent; border: none; font-size: 0.9rem; /* DIPERKECIL: sebelumnya 1rem */ cursor: pointer; color: var(--danger-color); }

/* Footer dengan Glow Tebal */
footer { position: fixed; bottom: 0; left: 0; width: 100%; background: var(--surface-color); border-top: 2px solid var(--glow-color); padding: 8px; text-align: center; box-shadow: 0 -5px 20px rgba(0, 210, 255, 0.25); }
footer p { font-size: 0.65rem; /* DIPERKECIL: sebelumnya 0.75rem */ color: var(--text-secondary); margin: 0; }

/* Custom Popup Tema Pantai (Ditebalkan juga nyalanya) */
.popup-overlay { position: fixed; top: 0; left: 0; width: 100vw; height: 100vh; background: rgba(13, 27, 42, 0.7); display: flex; justify-content: center; align-items: center; z-index: 9999; backdrop-filter: blur(3px); }
.popup-box { background: var(--surface-color); padding: 20px; border-radius: 12px; width: 85%; max-width: 350px; text-align: center; border: 2px solid var(--glow-color); box-shadow: 0 10px 30px rgba(0,210,255,0.4); }
.popup-box p { font-size: 0.85rem; /* DIPERKECIL: sebelumnya 1rem */ margin-bottom: 20px; font-weight: 600; color: var(--text-primary); }
.popup-actions { display: flex; justify-content: center; gap: 10px; }
.popup-actions button { padding: 8px 20px; border: none; border-radius: 8px; font-weight: 700; cursor: pointer; font-size: 0.8rem; /* DIPERKECIL */ }
.btn-popup-ok { background: var(--accent-color); color: #fff; }
.btn-popup-cancel { background: transparent; border: 1px solid var(--text-secondary) !important; color: var(--text-secondary); }
.hidden { display: none !important; }