* { box-sizing: border-box; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif; }
body { background: #121212; color: #fff; margin: 0; padding-bottom: 90px; }
header { background: #1e1e2d; padding: 15px; position: sticky; top: 0; z-index: 10; border-bottom: 1px solid #2a2a3b; }
.kody { font-size: 11px; color: #aaa; margin-bottom: 8px; text-align: right; }
.kody span { color: #00e676; font-weight: bold; }
h1 { margin: 0; font-size: 22px; font-weight: 600; color: #fff; }
.stats { display: flex; justify-content: space-around; background: #1e1e2d; padding: 15px 0; border-bottom: 1px solid #2a2a3b; }
.stats div { text-align: center; font-size: 12px; color: #aaa; text-transform: uppercase; letter-spacing: 0.5px; }
.stats b { font-size: 20px; color: #fff; font-weight: 700; display: block; margin-bottom: 4px; }
.tabs { display: flex; padding: 15px; gap: 10px; }
.tabs button { flex: 1; padding: 12px; background: #2a2a3b; border: none; border-radius: 8px; color: #aaa; font-weight: 600; cursor: pointer; transition: 0.2s; }
.tabs button.active { background: #00e676; color: #121212; }
.card { background: #1e1e2d; margin: 0 15px 15px; padding: 15px; border-radius: 12px; border-left: 5px solid #ff9800; display: flex; flex-direction: column; gap: 10px; }
.card.paid { border-left-color: #00e676; opacity: 0.6; }
.card.overdue { border-left-color: #f44336; }
.card-top { display: flex; justify-content: space-between; align-items: flex-start; }
.title { font-weight: 600; font-size: 16px; color: #fff; flex: 1; padding-right: 10px; line-height: 1.3; }
.amount { font-weight: 700; font-size: 16px; color: #00e676; white-space: nowrap; }
.meta { display: flex; flex-wrap: wrap; gap: 8px; font-size: 12px; color: #aaa; }
.badge { background: #2a2a3b; padding: 4px 8px; border-radius: 4px; font-weight: bold; }
.st-active { color: #ff9800; }
.st-paid { color: #00e676; }
.st-overdue { color: #f44336; background: rgba(244, 67, 54, 0.1); }
.actions { display: flex; gap: 10px; margin-top: 5px; }
.actions button { flex: 1; padding: 10px; border: none; border-radius: 6px; font-weight: 600; font-size: 13px; cursor: pointer; }
.btn-unpay { background: #2a2a3b; color: #fff; }
.btn-pay { background: #00e676; color: #121212; }
.empty { text-align: center; color: #aaa; padding: 40px 20px; }
#fab { position: fixed; bottom: 25px; right: 25px; width: 60px; height: 60px; border-radius: 30px; background: #00e676; color: #121212; font-size: 32px; border: none; box-shadow: 0 4px 15px rgba(0, 230, 118, 0.4); cursor: pointer; z-index: 100; display: flex; align-items: center; justify-content: center; }
.hidden { display: none !important; }
#modal { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.85); z-index: 1000; display: flex; align-items: center; justify-content: center; padding: 20px; }
.modal-content { background: #1e1e2d; padding: 25px; border-radius: 16px; width: 100%; max-width: 400px; }
.modal-content h2 { margin-top: 0; margin-bottom: 20px; font-size: 20px; }
.modal-content input, .modal-content select { width: 100%; padding: 12px; margin-bottom: 15px; background: #121212; border: 1px solid #2a2a3b; color: #fff; border-radius: 8px; font-size: 16px; outline: none; }
.modal-content input:focus { border-color: #00e676; }
.row { display: flex; gap: 10px; }
.row input { flex: 2; }
.row select { flex: 1; }
.modal-actions { display: flex; gap: 10px; margin-top: 10px; }
.modal-actions button { flex: 1; padding: 12px; border: none; border-radius: 8px; cursor: pointer; font-weight: bold; font-size: 15px; }
.btn-primary { background: #00e676; color: #121212; }
.btn-secondary { background: #2a2a3b; color: #fff; }

#login-screen { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px; background: #121212; }
.login-box { width: 100%; max-width: 380px; background: #1e1e2d; padding: 28px; border-radius: 16px; border: 1px solid #2a2a3b; }
.login-box h1 { margin: 0 0 8px; }
.login-lead { color: #aaa; font-size: 14px; line-height: 1.4; margin: 0 0 18px; }
#login-code { width: 100%; padding: 12px; margin-bottom: 12px; background: #121212; border: 1px solid #2a2a3b; color: #fff; border-radius: 8px; font-size: 18px; letter-spacing: 1px; }
#login-code:focus { outline: none; border-color: #00e676; }
.login-error { color: #f44336; font-size: 13px; margin: 0 0 12px; }
#btn-login { width: 100%; padding: 12px; border: none; border-radius: 8px; font-weight: 700; cursor: pointer; }
.kody { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
#btn-logout { background: #2a2a3b; color: #fff; border: none; border-radius: 6px; padding: 6px 10px; cursor: pointer; font-size: 12px; }
#who { color: #00e676; font-weight: 700; font-size: 12px; }

textarea { width: 100%; padding: 12px; margin-bottom: 15px; background: #121212; border: 1px solid #2a2a3b; color: #fff; border-radius: 8px; font-size: 15px; outline: none; resize: vertical; }
.note-files { display: flex; flex-direction: column; gap: 8px; margin-bottom: 14px; }
.att { display: flex; align-items: center; justify-content: space-between; gap: 8px; background: #121212; border: 1px solid #2a2a3b; border-radius: 8px; padding: 8px 10px; }
.att a { color: #00e676; text-decoration: none; word-break: break-all; font-size: 13px; }
.att button { background: #2a2a3b; color: #fff; border: none; border-radius: 6px; padding: 6px 8px; cursor: pointer; }
.file-btn { display: block; text-align: center; background: #2a2a3b; color: #fff; padding: 12px; border-radius: 8px; margin-bottom: 12px; cursor: pointer; font-weight: 600; }
.file-btn input { display: none; }
.note-count { font-size: 11px; color: #00e676; }

.tiles { display: flex; flex-wrap: wrap; gap: 8px; }
.tile-btn { background: #00e676; color: #121212; border: none; border-radius: 8px; padding: 8px 12px; font-weight: 700; font-size: 13px; cursor: pointer; letter-spacing: 0.3px; }
.tile-btn:active { opacity: 0.85; }
#tile-modal { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.85); z-index: 1000; display: flex; align-items: center; justify-content: center; padding: 20px; }

.note-hist { max-height: 180px; overflow: auto; margin-bottom: 12px; display: flex; flex-direction: column; gap: 8px; }
.note-entry { background: #121212; border: 1px solid #2a2a3b; border-radius: 8px; padding: 8px 10px; }
.note-date { color: #00e676; font-size: 12px; font-weight: 700; margin-bottom: 4px; }
.note-body { color: #e2e8f0; font-size: 14px; white-space: pre-wrap; }

#pay-modal { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.85); z-index: 1000; display: flex; align-items: center; justify-content: center; padding: 20px; }
.pay-choices { display: flex; flex-direction: column; gap: 8px; margin-bottom: 12px; }
.pay-choices .tile-btn { width: 100%; text-align: left; }

.search-bar { display: flex; align-items: center; gap: 8px; margin-top: 12px; background: #121212; border: 1px solid #2a2a3b; border-radius: 10px; padding: 0 12px; }
.search-ico { color: #00e676; font-size: 20px; line-height: 1; }
.search-bar input { flex: 1; border: none; background: transparent; color: #fff; padding: 12px 0; font-size: 16px; outline: none; margin: 0; }
.search-bar input::placeholder { color: #777; }
