/* ============================================
   דוח אפס - Zero Report - Main Stylesheet
   RTL Hebrew UI | Professional Blue/White
   ============================================ */

@import url('https://fonts.googleapis.com/css2?family=Assistant:wght@300;400;500;600;700&display=swap');

/* === Reset & Base === */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

:root {
    --primary:     #1a4b8c;
    --primary-dark:#133a6d;
    --accent:      #2d7dd2;
    --accent-light:#e8f2fc;
    --success:     #27ae60;
    --danger:      #e74c3c;
    --warning:     #f39c12;
    --bg:          #f5f7fa;
    --bg-white:    #ffffff;
    --text:        #2c3e50;
    --text-muted:  #6c7a89;
    --border:      #dde3ec;
    --shadow:      0 2px 12px rgba(26,75,140,0.10);
    --shadow-lg:   0 4px 24px rgba(26,75,140,0.15);
    --radius:      8px;
    --radius-lg:   12px;
    --transition:  0.2s ease;
}

html {
    font-size: 16px;
    direction: rtl;
}

body {
    font-family: 'Assistant', Arial, sans-serif;
    background: var(--bg);
    color: var(--text);
    direction: rtl;
    line-height: 1.6;
    min-height: 100vh;
}

/* === Typography === */
h1, h2, h3, h4 { font-weight: 700; color: var(--primary); line-height: 1.3; }
h1 { font-size: 1.8rem; }
h2 { font-size: 1.4rem; }
h3 { font-size: 1.15rem; }
p  { color: var(--text-muted); }
a  { color: var(--accent); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--primary); text-decoration: underline; }

/* === Layout === */
.container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 1rem;
}

.main-content {
    padding: 2rem 0 4rem;
}

/* === Header === */
.site-header {
    background: var(--primary);
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.header-inner {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 1rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 60px;
}

.header-logo {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.logo-link { text-decoration: none; display: flex; align-items: center; gap: 0.5rem; }
.logo-icon  { font-size: 1.5rem; }
.logo-text  { font-size: 1.4rem; font-weight: 700; color: white; letter-spacing: -0.5px; }

.header-nav {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.nav-greeting { color: rgba(255,255,255,0.8); font-size: 0.9rem; }
.nav-link     { color: rgba(255,255,255,0.9); font-size: 0.9rem; padding: 0.3rem 0.7rem; border-radius: 4px; transition: background var(--transition); }
.nav-link:hover { background: rgba(255,255,255,0.15); color: white; text-decoration: none; }
.nav-link-logout { border: 1px solid rgba(255,255,255,0.4); }

/* === Cards & Sections === */
.card, .section-card {
    background: var(--bg-white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    border: 1px solid var(--border);
}

.section-title {
    font-size: 1.2rem;
    color: var(--primary);
    margin-bottom: 1.2rem;
    padding-bottom: 0.7rem;
    border-bottom: 2px solid var(--accent-light);
}

/* === Step Indicators === */
.step-header {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    margin-bottom: 1.25rem;
}

.step-number {
    width: 40px;
    height: 40px;
    background: var(--primary);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    font-weight: 700;
    flex-shrink: 0;
}

.step-title h2 { margin-bottom: 0.15rem; font-size: 1.25rem; }
.step-title p  { font-size: 0.9rem; margin: 0; }

/* === Search Bar === */
.search-bar {
    display: flex;
    gap: 0.75rem;
    align-items: center;
}

.search-input {
    flex: 1;
    padding: 0.75rem 1rem;
    border: 2px solid var(--border);
    border-radius: var(--radius);
    font-size: 1rem;
    font-family: 'Assistant', Arial, sans-serif;
    direction: rtl;
    transition: border-color var(--transition), box-shadow var(--transition);
    color: var(--text);
}

.search-input:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(45,125,210,0.15);
}

.btn-search { min-width: 110px; }

/* === Buttons === */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    padding: 0.65rem 1.3rem;
    border: none;
    border-radius: var(--radius);
    font-size: 0.95rem;
    font-family: 'Assistant', Arial, sans-serif;
    font-weight: 600;
    cursor: pointer;
    transition: background var(--transition), transform var(--transition), box-shadow var(--transition);
    text-decoration: none;
    white-space: nowrap;
}

.btn:hover   { transform: translateY(-1px); box-shadow: 0 4px 12px rgba(0,0,0,0.15); }
.btn:active  { transform: translateY(0); }
.btn:disabled{ opacity: 0.55; cursor: not-allowed; transform: none; box-shadow: none; }

.btn-primary  { background: var(--primary); color: white; }
.btn-primary:hover { background: var(--primary-dark); color: white; text-decoration: none; }

.btn-secondary { background: white; color: var(--primary); border: 2px solid var(--primary); }
.btn-secondary:hover { background: var(--accent-light); text-decoration: none; }

.btn-success  { background: var(--success); color: white; }
.btn-success:hover { background: #219a52; color: white; text-decoration: none; }

.btn-danger   { background: var(--danger); color: white; font-size: 0.8rem; padding: 0.3rem 0.7rem; }
.btn-danger:hover { background: #c0392b; text-decoration: none; }

.btn-block    { width: 100%; }
.btn-wide     { min-width: 200px; }
.btn-large    { padding: 0.85rem 1.8rem; font-size: 1rem; }
.btn-sm       { padding: 0.3rem 0.7rem; font-size: 0.8rem; }

/* === Alerts === */
.alert {
    padding: 0.85rem 1.1rem;
    border-radius: var(--radius);
    margin: 1rem 0;
    font-size: 0.95rem;
    font-weight: 500;
}
.alert-error   { background: #fef2f2; color: #c0392b; border: 1px solid #fca5a5; }
.alert-success { background: #f0fdf4; color: #166534; border: 1px solid #86efac; }
.alert-info    { background: #eff6ff; color: #1e40af; border: 1px solid #93c5fd; }

/* === Map & Parcel Info === */
.parcel-info-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    margin-top: 1rem;
    padding: 1rem;
    background: var(--accent-light);
    border-radius: var(--radius);
    border: 1px solid #c3d9f0;
}

.parcel-item   { display: flex; align-items: center; gap: 0.4rem; }
.parcel-label  { font-size: 0.85rem; color: var(--text-muted); font-weight: 600; }
.parcel-value  { font-size: 0.95rem; color: var(--primary); font-weight: 700; }

/* === Stats Bar === */
.stats-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 1.5rem;
    margin-bottom: 1.2rem;
    padding: 1rem 1.2rem;
    background: var(--bg);
    border-radius: var(--radius);
    border: 1px solid var(--border);
}

.stat-item    { display: flex; align-items: center; gap: 0.5rem; }
.stat-label   { font-size: 0.9rem; color: var(--text-muted); }
.stat-value   { font-size: 1.1rem; font-weight: 700; color: var(--primary); }
.stat-item.highlight .stat-value { color: var(--success); font-size: 1.25rem; }

/* === Transactions Table === */
.table-wrapper {
    overflow-x: auto;
    border-radius: var(--radius);
    border: 1px solid var(--border);
}

.table-transactions,
.table-reports {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

.table-transactions th,
.table-reports th {
    background: var(--primary);
    color: white;
    padding: 0.75rem 0.9rem;
    text-align: right;
    font-weight: 600;
    white-space: nowrap;
}

.table-transactions td,
.table-reports td {
    padding: 0.65rem 0.9rem;
    border-bottom: 1px solid var(--border);
    color: var(--text);
}

.table-transactions tr:nth-child(even) td,
.table-reports tr:nth-child(even) td {
    background: #f9fbff;
}

.table-transactions tr:hover td,
.table-reports tr:hover td {
    background: var(--accent-light);
}

.address-cell { max-width: 200px; word-break: break-word; }
.actions-cell { white-space: nowrap; }

/* === Upload Area === */
.upload-area {
    border: 2px dashed var(--border);
    border-radius: var(--radius-lg);
    padding: 2.5rem 1.5rem;
    text-align: center;
    transition: border-color var(--transition), background var(--transition);
    margin-bottom: 1rem;
}

.upload-area:hover { border-color: var(--accent); background: var(--accent-light); }
.upload-area.drag-over { border-color: var(--primary); background: var(--accent-light); }

.upload-icon { font-size: 3rem; margin-bottom: 0.75rem; }
.upload-text { font-size: 1rem; color: var(--text); margin-bottom: 0.25rem; font-weight: 600; }
.upload-hint { font-size: 0.85rem; color: var(--text-muted); margin-bottom: 1rem; }
.file-input-hidden { display: none; }

.file-selected {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    margin-top: 0.75rem;
    padding: 0.5rem 1rem;
    background: var(--accent-light);
    border-radius: var(--radius);
    font-size: 0.9rem;
    color: var(--primary);
    font-weight: 600;
}

.btn-icon {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--danger);
    font-size: 1rem;
    padding: 0 0.25rem;
    line-height: 1;
}

/* === Loading === */
.loading-section {
    text-align: center;
    padding: 2rem;
    color: var(--text-muted);
}

.spinner {
    display: inline-block;
    width: 40px;
    height: 40px;
    border: 4px solid var(--border);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin-bottom: 0.75rem;
}

@keyframes spin { to { transform: rotate(360deg); } }

.loading-overlay {
    position: fixed;
    inset: 0;
    background: rgba(255,255,255,0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

/* === תב"ע Rights Grid === */
.taba-rights-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1rem;
    margin-bottom: 1rem;
}

.rights-card {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.2rem;
    text-align: center;
    transition: box-shadow var(--transition);
}

.rights-card:hover { box-shadow: var(--shadow); }
.rights-label  { font-size: 0.8rem; color: var(--text-muted); font-weight: 600; margin-bottom: 0.4rem; }
.rights-value  { font-size: 1.8rem; font-weight: 700; color: var(--primary); line-height: 1.2; }
.rights-value.rights-text { font-size: 1rem; }
.rights-unit   { font-size: 0.75rem; color: var(--text-muted); margin-top: 0.2rem; }

.notes-box {
    background: #fffbeb;
    border: 1px solid #fde68a;
    border-radius: var(--radius);
    padding: 0.85rem 1rem;
    font-size: 0.9rem;
    color: #92400e;
    margin-top: 0.5rem;
}

/* === Financial Cards === */
.financial-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-bottom: 1rem;
}

.financial-card {
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    text-align: center;
    transition: transform var(--transition), box-shadow var(--transition);
    border: 1px solid var(--border);
}

.financial-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); }

.financial-card.revenue  { background: linear-gradient(135deg, #e8f5e9, #f1f8e9); }
.financial-card.cost     { background: linear-gradient(135deg, #fff3e0, #fbe9e7); }
.financial-card.profit   { background: linear-gradient(135deg, #e3f2fd, #e8eaf6); }
.financial-card.roi      { background: linear-gradient(135deg, #f3e5f5, #ede7f6); }

.fin-card-icon  { font-size: 2rem; margin-bottom: 0.5rem; }
.fin-card-label { font-size: 0.85rem; color: var(--text-muted); font-weight: 600; margin-bottom: 0.4rem; }
.fin-card-value { font-size: 1.5rem; font-weight: 700; color: var(--primary); line-height: 1.2; }
.fin-card-sub   { font-size: 0.75rem; color: var(--text-muted); margin-top: 0.3rem; }

.roi-value { font-size: 2rem; }
.badge-positive { color: var(--success) !important; }
.badge-negative { color: var(--danger) !important; }

.assumptions-box {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 0.85rem 1rem;
    font-size: 0.85rem;
    color: var(--text-muted);
}

/* === Actions Bar === */
.actions-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
    background: var(--bg-white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
    margin-bottom: 2rem;
}

/* === Page Header === */
.page-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.page-subtitle { font-size: 0.9rem; color: var(--text-muted); margin-top: 0.25rem; }
.page-actions  { display: flex; gap: 0.75rem; flex-wrap: wrap; }

/* === Auth Pages === */
.auth-page { display: flex; align-items: center; justify-content: center; min-height: 100vh; background: var(--bg); }
.auth-container { width: 100%; max-width: 420px; padding: 1rem; }

.auth-card {
    background: white;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    padding: 2.5rem 2rem;
    border: 1px solid var(--border);
}

.auth-logo {
    text-align: center;
    margin-bottom: 2rem;
}

.auth-logo h1 {
    font-size: 2rem;
    color: var(--primary);
    margin-bottom: 0.25rem;
}

.auth-logo p { font-size: 0.9rem; color: var(--text-muted); }

.auth-footer { text-align: center; margin-top: 1.5rem; font-size: 0.9rem; color: var(--text-muted); }

/* === Forms === */
.form-group { margin-bottom: 1.1rem; }
.form-group label { display: block; font-size: 0.9rem; font-weight: 600; color: var(--text); margin-bottom: 0.4rem; }

.form-group input[type="text"],
.form-group input[type="email"],
.form-group input[type="password"] {
    width: 100%;
    padding: 0.7rem 1rem;
    border: 2px solid var(--border);
    border-radius: var(--radius);
    font-size: 0.95rem;
    font-family: 'Assistant', Arial, sans-serif;
    direction: rtl;
    color: var(--text);
    transition: border-color var(--transition), box-shadow var(--transition);
}

.form-group input:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(45,125,210,0.15);
}

/* === Badges === */
.badge {
    display: inline-block;
    padding: 0.25rem 0.6rem;
    border-radius: 20px;
    font-size: 0.78rem;
    font-weight: 600;
}

.badge-draft    { background: #fef3c7; color: #92400e; }
.badge-complete { background: #d1fae5; color: #065f46; }

/* === Info Grid (Dashboard) === */
.info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 0.75rem;
}

.info-item  { display: flex; flex-direction: column; gap: 0.2rem; }
.info-label { font-size: 0.82rem; color: var(--text-muted); font-weight: 600; }
.info-value { font-size: 0.95rem; color: var(--text); font-weight: 500; }

/* === Empty State === */
.empty-state {
    text-align: center;
    padding: 4rem 2rem;
    background: white;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
}

.empty-icon { font-size: 4rem; margin-bottom: 1rem; }
.empty-state h2 { color: var(--primary); margin-bottom: 0.5rem; }
.empty-state p  { margin-bottom: 1.5rem; }

/* === Sub Heading === */
.sub-heading {
    font-size: 1rem;
    color: var(--primary);
    margin: 1.5rem 0 0.75rem;
    padding-right: 0.75rem;
    border-right: 3px solid var(--accent);
}

/* === Link in alert === */
.link-white { color: inherit; text-decoration: underline; font-weight: 700; }

/* === Utility === */
.hidden  { display: none !important; }
.text-center { text-align: center; }
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }

/* ============================================
   Responsive
   ============================================ */

@media (max-width: 768px) {
    h1 { font-size: 1.4rem; }
    h2 { font-size: 1.15rem; }

    .header-inner { padding: 0 0.75rem; }
    .logo-text { font-size: 1.1rem; }
    .nav-greeting { display: none; }

    .main-content { padding: 1rem 0 3rem; }
    .container { padding: 0 0.75rem; }

    .section-card { padding: 1.1rem; }
    .search-bar { flex-direction: column; }
    .search-input { width: 100%; }
    .btn-search { width: 100%; }

    .taba-rights-grid { grid-template-columns: repeat(2, 1fr); }
    .financial-grid   { grid-template-columns: repeat(2, 1fr); }

    .parcel-info-bar { gap: 0.5rem; }
    .stats-bar { flex-direction: column; gap: 0.5rem; }

    .page-header { flex-direction: column; }
    .page-actions { width: 100%; }

    .actions-bar { flex-direction: column; }
    .actions-bar .btn { width: 100%; }

    .auth-card { padding: 1.75rem 1.25rem; }

    .table-transactions th,
    .table-transactions td { padding: 0.5rem 0.6rem; font-size: 0.82rem; }

    .table-reports th,
    .table-reports td { padding: 0.5rem 0.6rem; font-size: 0.82rem; }
}

@media (max-width: 480px) {
    .taba-rights-grid { grid-template-columns: 1fr 1fr; }
    .financial-grid   { grid-template-columns: 1fr; }
    .rights-value     { font-size: 1.4rem; }
    .fin-card-value   { font-size: 1.2rem; }
}
