/* Tulasee Vanam - Programs / Events Diary
   Saffron / cream / gold theme. No dark backgrounds anywhere. */

#tvn-diary-app, #tvn-diary-app * { box-sizing: border-box; }

#tvn-diary-app {
    font-family: 'Segoe UI', Tahoma, Arial, sans-serif;
    background: #FFFDF7;
    color: #3a2c1a;
    max-width: 900px;
    margin: 0 auto;
    padding: 14px;
    border: 1px solid #F0DFC0;
    border-radius: 10px;
}

.tvn-boot-loading { text-align: center; padding: 30px; font-weight: 700; color: #A6531A; }

/* ---------- Header ---------- */
.tvn-header {
    display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between;
    gap: 10px; background: linear-gradient(135deg,#FFF6E8,#FFFDF7);
    border: 1px solid #F0DFC0; border-radius: 10px; padding: 12px 16px; margin-bottom: 14px;
}
.tvn-title { font-size: 19px; font-weight: 800; color: #A6531A; margin: 0; }
.tvn-subtitle { font-size: 12.5px; font-weight: 600; color: #8a6a3a; margin-top: 2px; }

.tvn-lang-toggle { display: flex; gap: 4px; }
.tvn-pill {
    border: 1.5px solid #C97A1E; background: #FFFDF7; color: #A6531A; font-weight: 700;
    padding: 5px 12px; border-radius: 999px; cursor: pointer; font-size: 12.5px;
}
.tvn-pill.active { background: #C97A1E; color: #fff; }

.tvn-sync-status { font-size: 12px; font-weight: 700; padding: 4px 10px; border-radius: 999px; }
.tvn-sync-status.online { background: #E7F6E7; color: #2e7d32; }
.tvn-sync-status.offline { background: #FDEBEA; color: #c62828; }

/* ---------- Top action buttons (single shortcode, multiple views) ---------- */
.tvn-top-buttons { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }
.tvn-btn {
    border: none; border-radius: 8px; padding: 9px 16px; font-weight: 700; font-size: 13.5px;
    cursor: pointer; color: #fff; background: #C97A1E;
}
.tvn-btn:hover { background: #A6531A; }
.tvn-btn.secondary { background: #FFF6E8; color: #A6531A; border: 1.5px solid #C97A1E; }
.tvn-btn.green { background: #2e7d32; }
.tvn-btn.orange { background: #C97A1E; }
.tvn-btn.red { background: #c62828; }
.tvn-btn.active { outline: 3px solid #F0C27B; }
.tvn-btn:disabled { opacity: .5; cursor: not-allowed; }

/* ---------- Calendar nav row ---------- */
.tvn-cal-nav { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 10px; flex-wrap: wrap; }
.tvn-cal-nav .tvn-range-label { font-weight: 700; color: #A6531A; font-size: 13.5px; }

/* ---------- Calendar grid ---------- */
.tvn-cal-grid {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr));
    gap: 8px; margin-bottom: 10px;
}
.tvn-day-cell {
    position: relative; background: #FFF6E8; border: 1.5px solid #F0DFC0; border-radius: 10px;
    padding: 10px 6px; text-align: center; cursor: pointer; min-height: 74px;
}
.tvn-day-cell:hover { border-color: #C97A1E; }
.tvn-day-cell.today { border-color: #C97A1E; background: #FFEFD5; box-shadow: 0 0 0 2px #F0C27B inset; }
.tvn-day-cell.selected { border-color: #2e7d32; background: #E7F6E7; box-shadow: 0 0 0 2px #2e7d32 inset; }
.tvn-select-check {
    position: absolute; top: -8px; left: -6px; background: #2e7d32; color: #fff;
    font-size: 11px; font-weight: 800; width: 20px; height: 20px; border-radius: 999px;
    display: flex; align-items: center; justify-content: center; box-shadow: 0 0 0 2px #FFFDF7;
}
.tvn-day-weekday { font-size: 11px; font-weight: 700; color: #8a6a3a; }
.tvn-day-num { font-size: 19px; font-weight: 800; color: #3a2c1a; }
.tvn-day-month { font-size: 10.5px; font-weight: 600; color: #8a6a3a; }

.tvn-badge {
    position: absolute; top: -8px; right: -6px; background: #d32f2f; color: #fff;
    font-size: 11px; font-weight: 800; min-width: 20px; height: 20px; border-radius: 999px;
    display: flex; align-items: center; justify-content: center; padding: 0 4px;
    animation: tvnBlink 1s infinite;
    box-shadow: 0 0 0 2px #FFFDF7;
}
@keyframes tvnBlink { 0%,100% { opacity: 1; } 50% { opacity: .25; } }

/* ---------- Fixed overlays / modals (appended to body) ---------- */
.tvn-overlay {
    position: fixed; inset: 0; background: rgba(58,44,26,0.45);
    display: flex; align-items: center; justify-content: center; z-index: 99999; padding: 14px;
}
.tvn-modal {
    background: #FFFDF7; border-radius: 12px; border: 1px solid #F0DFC0;
    max-width: 480px; width: 100%; max-height: 88vh; overflow-y: auto; padding: 18px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.25);
}
.tvn-modal-title { font-size: 16.5px; font-weight: 800; color: #A6531A; margin: 0 0 12px 0; }
.tvn-modal-close { float: right; background: none; border: none; font-size: 20px; font-weight: 800; color: #A6531A; cursor: pointer; }

/* ---------- Day list ---------- */
.tvn-record-card {
    background: #FFF6E8; border: 1px solid #F0DFC0; border-radius: 8px; padding: 10px; margin-bottom: 8px;
}
.tvn-record-card .tvn-rc-desc { font-weight: 800; color: #3a2c1a; font-size: 14px; }
.tvn-record-card .tvn-rc-meta { font-size: 12px; font-weight: 600; color: #8a6a3a; margin-top: 3px; }
.tvn-status-pill { font-size: 10.5px; font-weight: 800; padding: 2px 8px; border-radius: 999px; margin-left: 6px; }
.tvn-status-pill.pending { background: #FFF3CD; color: #8a6a00; }
.tvn-status-pill.approved { background: #E7F6E7; color: #2e7d32; }
.tvn-status-pill.rejected { background: #FDEBEA; color: #c62828; }

/* ---------- Forms ---------- */
.tvn-field { margin-bottom: 12px; }
.tvn-field label { display: block; font-weight: 700; color: #3a2c1a; font-size: 13px; margin-bottom: 4px; }
.tvn-field input, .tvn-field textarea {
    width: 100%; padding: 9px 10px; border: 1.5px solid #E0C79A; border-radius: 7px;
    font-size: 14px; font-weight: 700; color: #3a2c1a; background: #fff;
}
.tvn-field input:focus, .tvn-field textarea:focus {
    outline: none; border-color: #C97A1E; background: #FFF9C4;
}
.tvn-field textarea { min-height: 60px; resize: vertical; }
.tvn-balance-box {
    background: #FFEFD5; border: 1.5px dashed #C97A1E; border-radius: 8px; padding: 10px;
    font-weight: 800; color: #A6531A; font-size: 15px; text-align: center;
}
.tvn-two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
@media (max-width: 420px) { .tvn-two-col { grid-template-columns: 1fr; } }

.tvn-msg { font-weight: 700; font-size: 13px; padding: 8px 10px; border-radius: 7px; margin-bottom: 10px; }
.tvn-msg.ok { background: #E7F6E7; color: #2e7d32; }
.tvn-msg.err { background: #FDEBEA; color: #c62828; }
.tvn-msg.offline { background: #FFF3CD; color: #8a6a00; }

/* ---------- Admin panel ---------- */
.tvn-stats-row { display: grid; grid-template-columns: repeat(4,1fr); gap: 8px; margin-bottom: 12px; }
.tvn-stat-box { background: #FFF6E8; border: 1px solid #F0DFC0; border-radius: 8px; padding: 10px; text-align: center; }
.tvn-stat-box .n { font-size: 20px; font-weight: 800; color: #A6531A; }
.tvn-stat-box .l { font-size: 11px; font-weight: 700; color: #8a6a3a; }

.tvn-filter-bar { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; align-items: center; }
.tvn-filter-bar input[type=text] {
    flex: 1; min-width: 140px; padding: 7px 10px; border: 1.5px solid #E0C79A; border-radius: 7px; font-weight: 700;
}

.tvn-table-wrap { overflow-x: auto; }
table.tvn-admin-table { width: 100%; border-collapse: collapse; font-size: 13px; }
table.tvn-admin-table th, table.tvn-admin-table td {
    border: 1px solid #F0DFC0; padding: 6px 8px; text-align: left;
    word-break: break-word; font-size: 13px; vertical-align: top;
}
table.tvn-admin-table th { background: #FFF6E8; color: #A6531A; font-weight: 800; }
table.tvn-admin-table td { color: #3a2c1a; font-weight: 600; }

.tvn-row-btns { display: flex; gap: 4px; flex-wrap: wrap; }
.tvn-row-btns button { padding: 4px 8px; font-size: 12px; border-radius: 6px; }

.tvn-bulk-bar { display: flex; gap: 6px; align-items: center; margin-bottom: 8px; flex-wrap: wrap; }
.tvn-bulk-bar .count { font-weight: 700; color: #8a6a3a; font-size: 12.5px; }

.tvn-edit-strip td { background: #FFEFD5; }
.tvn-edit-strip input, .tvn-edit-strip textarea {
    width: 100%; padding: 5px 6px; border: 1.5px solid #C97A1E; border-radius: 5px;
    font-weight: 700; font-size: 12.5px; color: #3a2c1a;
}

.tvn-logout-row { display: flex; justify-content: flex-end; margin-bottom: 8px; }

/* ---------- Demo walkthrough ---------- */
.tvn-demo-cursor {
    position: fixed; width: 22px; height: 22px; border-radius: 50%;
    background: rgba(201,122,30,0.85); border: 2px solid #fff; z-index: 999999;
    pointer-events: none; transition: top .5s ease, left .5s ease; box-shadow: 0 0 8px rgba(0,0,0,.3);
}
.tvn-demo-caption {
    position: fixed; background: #A6531A; color: #fff; font-weight: 700; font-size: 13px;
    padding: 8px 14px; border-radius: 8px; z-index: 999999; max-width: 260px; box-shadow: 0 4px 14px rgba(0,0,0,.25);
}

@media (max-width: 480px) {
    .tvn-title { font-size: 16px; }
    .tvn-stats-row { grid-template-columns: repeat(2,1fr); }
}
