@import url('https://fonts.googleapis.com/css2?family=Heebo:wght@400;500;700;900&display=swap');

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
    font-family: 'Heebo', 'Segoe UI', Tahoma, Arial, sans-serif;
    background: #f4f4f4;
    color: #1a1a2e;
    line-height: 1.6;
    direction: rtl;
}

.container { max-width: 900px; margin: 0 auto; padding: 20px; }
.container.wide { max-width: 1400px; }

/* Branding */
.branding {
    display: flex; align-items: center; gap: 14px;
    padding-bottom: 14px; margin-bottom: 14px;
    border-bottom: 1px solid rgba(255,255,255,0.15);
}
.branding-logo { width: 52px; height: 52px; border-radius: 50%; background: white; padding: 3px; }
.branding-logo img { width: 100%; height: 100%; object-fit: contain; }
.branding-text { display: flex; flex-direction: column; }
.branding-title { font-size: 1.1em; font-weight: 700; color: white; }
.branding-sub { font-size: 0.85em; color: #8ecae6; }

/* Header */
.main-header {
    background: linear-gradient(135deg, #1f5fa6 0%, #009dc3 100%);
    color: white;
    padding: 24px 30px;
    border-radius: 12px;
    margin-bottom: 24px;
    box-shadow: 0 4px 15px rgba(31,95,166,0.25);
}
.main-header h1 { font-size: 1.6em; margin-bottom: 4px; font-weight: 700; }
.main-header .subtitle { color: #c8e6f5; font-size: 0.95em; }
.header-row { display: flex; align-items: center; gap: 16px; margin-bottom: 12px; }
.back-btn {
    color: #2ad5ff; text-decoration: none; font-size: 0.95em; white-space: nowrap;
    padding: 4px 12px; border: 1px solid #2ad5ff; border-radius: 6px;
    transition: background 0.2s;
}
.back-btn:hover { background: rgba(42,213,255,0.15); }

.date-picker-row {
    display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
    background: rgba(255,255,255,0.1); padding: 10px 16px; border-radius: 8px; margin-top: 8px;
}
.date-picker-row label { color: #c8e6f5; font-size: 0.9em; }
.date-picker-row input {
    padding: 6px 12px; border: 1px solid rgba(255,255,255,0.3); border-radius: 6px;
    background: rgba(255,255,255,0.15); color: white; font-size: 0.95em; font-family: inherit;
}
.separator { color: rgba(255,255,255,0.3); margin: 0 4px; }

/* Buttons */
.btn {
    padding: 8px 18px; border: none; border-radius: 8px; cursor: pointer;
    font-size: 0.9em; font-weight: 600; transition: all 0.2s; font-family: inherit;
}
.btn-primary { background: #009dc3; color: white; }
.btn-primary:hover { background: #008aad; transform: translateY(-1px); }
.btn-secondary { background: #1f5fa6; color: white; }
.btn-secondary:hover { background: #184d8a; }
.btn-large { font-size: 1.1em; padding: 12px 40px; }

/* Home Grid */
.home-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 20px;
}
.home-card {
    background: white; border-radius: 12px; padding: 30px 24px;
    text-decoration: none; color: inherit; text-align: center;
    box-shadow: 0 2px 10px rgba(0,0,0,0.06);
    transition: all 0.3s; border: 2px solid transparent;
}
.home-card:hover { transform: translateY(-4px); box-shadow: 0 8px 25px rgba(31,95,166,0.15); }
.home-card .card-icon { font-size: 2.5em; margin-bottom: 12px; }
.home-card h2 { font-size: 1.2em; margin-bottom: 6px; color: #1f5fa6; }
.home-card p { color: #636e72; font-size: 0.9em; }
.dashboard-card { border-color: #1f5fa6; }
.dashboard-card:hover { border-color: #009dc3; }
.station-card:hover { border-color: #459524; }

/* Form Sections */
.section-block {
    background: white; border-radius: 12px; padding: 24px;
    margin-bottom: 20px; box-shadow: 0 2px 10px rgba(0,0,0,0.06);
}
.section-title {
    font-size: 1.2em; padding-bottom: 12px; margin-bottom: 16px;
    border-bottom: 3px solid #e2e8f0; font-weight: 700;
}
.morning-title { border-color: #f7942d; color: #f37d00; }
.afternoon-title { border-color: #009dc3; color: #1f5fa6; }
.general-title { border-color: #459524; color: #459524; }

.field-group {
    margin-bottom: 16px; padding: 12px 16px;
    background: #f7f9fc; border-radius: 8px; border-right: 4px solid #dfe6e9;
}
.group-title { font-size: 0.95em; color: #636e72; margin-bottom: 10px; font-weight: 500; }

.field-row {
    display: flex; align-items: center; gap: 12px;
    margin-bottom: 8px; flex-wrap: wrap;
}
.field-row label {
    min-width: 200px; font-size: 0.9em; color: #2d3436; font-weight: 500;
}
.field-row input, .field-row textarea {
    flex: 1; min-width: 150px; padding: 8px 12px;
    border: 1px solid #dfe6e9; border-radius: 6px; font-size: 0.95em;
    font-family: inherit; transition: border-color 0.2s;
}
.field-row input:focus, .field-row textarea:focus {
    outline: none; border-color: #009dc3; box-shadow: 0 0 0 3px rgba(0,157,195,0.15);
}
.field-row input[type="number"] { max-width: 120px; text-align: center; }

.form-actions { text-align: center; margin: 24px 0; }

/* Status Message */
.status-msg {
    padding: 12px 20px; border-radius: 8px; text-align: center;
    font-weight: 600; margin-bottom: 16px; transition: opacity 0.3s;
}
.status-msg.hidden { display: none; }
.status-msg.success { background: #e8f5e9; color: #2e7d32; border: 1px solid #a5d6a7; }
.status-msg.error { background: #fce4ec; color: #c62828; border: 1px solid #ef9a9a; }

/* Edit Log */
.edit-log-table { width: 100%; border-collapse: collapse; font-size: 0.85em; }
.edit-log-table th { background: #e1f5fe; padding: 8px 12px; text-align: right; border-bottom: 2px solid #009dc3; color: #1f5fa6; }
.edit-log-table td { padding: 8px 12px; border-bottom: 1px solid #edf2f7; }

/* Dashboard */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(380px, 1fr));
    gap: 20px;
}
.dashboard-card {
    background: white; border-radius: 12px; padding: 20px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.06); border-right: 5px solid #459524;
}
.dashboard-card.no-data { border-right-color: #d96350; opacity: 0.7; }
.card-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.card-header h3 { font-size: 1.1em; color: #1f5fa6; }
.badge {
    padding: 3px 10px; border-radius: 12px; font-size: 0.75em; font-weight: 600;
}
.badge-ok { background: #e8f5e9; color: #2e7d32; }
.badge-missing { background: #fce4ec; color: #c62828; }

.mini-section { margin-bottom: 12px; }
.mini-section h4 {
    font-size: 0.85em; color: #1f5fa6; margin-bottom: 6px;
    padding-bottom: 4px; border-bottom: 1px solid #e1f5fe;
}
.mini-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 4px 12px; }
.mini-item { display: flex; justify-content: space-between; font-size: 0.85em; padding: 2px 0; }
.mini-label { color: #636e72; }
.mini-value { font-weight: 700; color: #009dc3; }

.notes-list { margin-top: 6px; }
.note-item {
    font-size: 0.82em; padding: 4px 8px; margin: 2px 0;
    background: #fff8e1; border-radius: 4px; border-right: 3px solid #f7942d;
}
.general-note {
    margin-top: 8px; padding: 8px 12px; background: #e8f5e9;
    border-radius: 6px; font-size: 0.85em; border-right: 3px solid #459524;
}
.card-footer { margin-top: 10px; padding-top: 8px; border-top: 1px solid #edf2f7; }
.link-btn { color: #009dc3; font-size: 0.8em; text-decoration: none; font-weight: 500; }
.link-btn:hover { text-decoration: underline; color: #1f5fa6; }

/* Monthly View */
.monthly-station {
    background: white; border-radius: 12px; padding: 20px; margin-bottom: 20px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.06);
}
.monthly-station h3 {
    font-size: 1.1em; margin-bottom: 12px; padding-bottom: 8px;
    border-bottom: 2px solid #009dc3; color: #1f5fa6;
}
.table-wrapper { overflow-x: auto; }
.data-table { width: 100%; border-collapse: collapse; font-size: 0.78em; white-space: nowrap; }
.data-table th {
    background: #e1f5fe; padding: 6px 8px; text-align: center;
    border-bottom: 2px solid #009dc3; position: sticky; top: 0; color: #1f5fa6;
}
.data-table td { padding: 5px 8px; text-align: center; border-bottom: 1px solid #edf2f7; }
.data-table tr:hover { background: #f0f9ff; }
.notes-cell { text-align: right; white-space: normal; max-width: 300px; font-size: 0.9em; }
.no-data-text { color: #b2bec3; font-style: italic; padding: 20px; }
.summary-row { margin-top: 8px; font-size: 0.9em; color: #636e72; }
.error-text { color: #d96350; text-align: center; padding: 20px; }
.view-title { font-size: 1.3em; margin-bottom: 20px; color: #1f5fa6; font-weight: 700; }

/* Login */
.login-block { max-width: 400px; margin: 40px auto; }
.login-form { display: flex; flex-direction: column; gap: 16px; }
.login-form select {
    flex: 1; padding: 8px 12px; border: 1px solid #dfe6e9;
    border-radius: 6px; font-size: 0.95em; font-family: inherit;
}
.login-form select:focus { outline: none; border-color: #009dc3; }

/* Tabs */
.tab-bar {
    display: flex; gap: 8px; margin-top: 12px;
}
.tab-btn {
    padding: 8px 20px; border: 1px solid rgba(255,255,255,0.3); border-radius: 8px;
    background: transparent; color: #c8e6f5; cursor: pointer;
    font-size: 0.9em; font-weight: 600; transition: all 0.2s; font-family: inherit;
}
.tab-btn.active { background: rgba(255,255,255,0.2); color: white; border-color: #2ad5ff; }
.tab-btn:hover { background: rgba(255,255,255,0.1); }

.tab-content { display: none; }
.tab-content.active { display: block; }

/* Calendar */
.month-nav {
    display: flex; align-items: center; justify-content: space-between;
    margin-bottom: 20px;
}
.month-title { font-size: 1.3em; color: #1f5fa6; font-weight: 700; }

.calendar-grid {
    display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px;
}
.cal-header {
    text-align: center; font-weight: 700; font-size: 0.85em; color: #1f5fa6;
    padding: 8px 0; border-bottom: 2px solid #009dc3;
}
.cal-cell {
    position: relative; text-align: center; padding: 12px 4px; border-radius: 8px;
    cursor: pointer; transition: all 0.2s; min-height: 50px;
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    border: 2px solid transparent;
}
.cal-cell:hover:not(.empty) { background: #e1f5fe; border-color: #009dc3; }
.cal-cell.empty { cursor: default; }
.cal-cell.reported { background: #e8f5e9; border-color: #459524; }
.cal-cell.not-reported { background: #fff8e1; }
.cal-cell.today { border-color: #009dc3; box-shadow: 0 0 0 2px rgba(0,157,195,0.3); }
.cal-cell.shabbat { background: #f5f5f5; color: #b2bec3; cursor: default; }
.cal-day { font-size: 1em; font-weight: 600; }
.cal-check { color: #459524; font-size: 0.8em; margin-top: 2px; }

.calendar-legend {
    display: flex; gap: 16px; margin-top: 16px; justify-content: center; flex-wrap: wrap;
}
.legend-item { display: flex; align-items: center; gap: 4px; font-size: 0.8em; color: #636e72; }
.legend-dot {
    width: 12px; height: 12px; border-radius: 4px; display: inline-block;
}
.legend-dot.reported { background: #e8f5e9; border: 1px solid #459524; }
.legend-dot.not-reported { background: #fff8e1; border: 1px solid #f7942d; }
.legend-dot.today-dot { background: white; border: 2px solid #009dc3; }
.legend-dot.shabbat { background: #f5f5f5; border: 1px solid #dfe6e9; }

/* Summary */
.summary-cards { margin-top: 20px; }
.summary-stat { font-size: 1em; margin-bottom: 12px; color: #1f5fa6; font-weight: 500; }
.summary-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; }
.summary-section {
    background: #f0f9ff; border-radius: 8px; padding: 12px 16px;
}
.summary-section h4 {
    font-size: 0.9em; color: #1f5fa6; margin-bottom: 8px;
    padding-bottom: 4px; border-bottom: 1px solid #b3e5fc;
}
.summary-item {
    display: flex; justify-content: space-between; padding: 3px 0;
    font-size: 0.85em;
}
.summary-val { font-weight: 700; color: #009dc3; }

/* Data Table Totals */
.totals-row { background: #e8f5e9 !important; }
.totals-row td { border-top: 2px solid #459524; }

/* Responsive */
@media (max-width: 768px) {
    .container { padding: 12px; }
    .main-header { padding: 16px 20px; }
    .main-header h1 { font-size: 1.2em; }
    .field-row { flex-direction: column; align-items: stretch; }
    .field-row label { min-width: auto; }
    .field-row input[type="number"] { max-width: 100%; }
    .dashboard-grid { grid-template-columns: 1fr; }
    .home-grid { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); }
    .date-picker-row { flex-direction: column; align-items: stretch; }
}
