/* ============================================================
   ECOVERSE SOLUTIONS LIMITED — Solar Portal Theme
   Brand colors:
     Primary dark green : #1a3c1f
     Sidebar green      : #0f2714
     Accent lime green  : #8dc63f
     Mid green          : #276749  (kept for content cards/badges)
   ============================================================ */

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

:root {
    --primary:       #1a3c1f;    /* dark forest green — sidebar, headers */
    --primary-dark:  #0f2714;    /* deeper green — sidebar bg */
    --primary-mid:   #276749;    /* mid green — buttons, badges, success */
    --accent:        #8dc63f;    /* lime green — active states, highlights */
    --accent-dark:   #6fa832;    /* darker lime — hover states */
    --accent-light:  #d4edaa;    /* pale lime — light backgrounds */

    --navy:          #1a2744;    /* used in PDF/BOQ tables — keep as is */
    --white:         #ffffff;
    --off-white:     #f0f4f8;
    --light-gray:    #f7fafc;
    --border:        #e2e8f0;
    --text-dark:     #1a202c;
    --text-mid:      #4a5568;
    --text-light:    #718096;
    --text-faint:    #a0aec0;

    --danger:        #c53030;
    --warning:       #6fa832;
    --info:          #2b6cb0;
    --success:       #276749;

    --sidebar-width: 240px;
    --topbar-height: 60px;
    --border-radius: 10px;
    --shadow-sm:     0 1px 3px rgba(0,0,0,0.08);
    --shadow-md:     0 4px 12px rgba(0,0,0,0.10);
    --shadow-lg:     0 8px 24px rgba(0,0,0,0.14);
    --transition:    0.2s ease;
}

html { font-size: 14px; }
body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: var(--off-white);
    color: var(--text-dark);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

a { color: var(--primary-mid); text-decoration: none; }
a:hover { color: var(--accent-dark); }

/* ── Layout ── */
.layout { display: flex; min-height: 100vh; }

/* ── Sidebar ── */
.sidebar {
    width: var(--sidebar-width);
    background: var(--primary-dark);
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0; left: 0; bottom: 0;
    z-index: 100;
    overflow-y: auto;
    overflow-x: hidden;
    scrollbar-width: thin;
    scrollbar-color: rgba(255,255,255,0.1) transparent;
}
.sidebar::-webkit-scrollbar { width: 4px; }
.sidebar::-webkit-scrollbar-track { background: transparent; }
.sidebar::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.15); border-radius: 2px; }

.sidebar-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 18px 16px 16px;
    border-bottom: 1px solid rgba(255,255,255,0.08);
    flex-shrink: 0;
}
.logo-icon {
    width: 38px; height: 38px;
    background: var(--accent);
    border-radius: 9px;
    display: flex; align-items: center; justify-content: center;
    font-size: 20px; flex-shrink: 0;
    overflow: hidden;
}
.logo-text {
    font-size: 14px; font-weight: 800;
    color: var(--white); letter-spacing: 0.2px;
}
.logo-sub {
    font-size: 10px; color: var(--accent);
    font-weight: 600; letter-spacing: 0.5px;
    text-transform: uppercase; margin-top: 1px;
}

.sidebar-nav { flex: 1; padding: 10px 0; }

.nav-section {
    padding: 10px 16px 4px;
    font-size: 10px; font-weight: 700;
    color: rgba(255,255,255,0.35);
    text-transform: uppercase; letter-spacing: 0.8px;
}

.nav-item {
    display: flex; align-items: center; gap: 10px;
    padding: 10px 16px;
    color: rgba(255,255,255,0.72);
    font-size: 13px; font-weight: 500;
    cursor: pointer;
    border-left: 3px solid transparent;
    transition: all var(--transition);
    text-decoration: none;
    position: relative;
}
.nav-item:hover {
    background: rgba(141,198,63,0.10);
    color: var(--white);
    border-left-color: rgba(141,198,63,0.4);
}
.nav-item.active {
    background: rgba(141,198,63,0.15);
    color: var(--white);
    border-left-color: var(--accent);
    font-weight: 700;
}
.nav-item.active .nav-icon { color: var(--accent); }
.nav-icon { width: 20px; text-align: center; font-size: 16px; flex-shrink: 0; }

.sidebar-footer {
    padding: 14px 16px;
    border-top: 1px solid rgba(255,255,255,0.08);
    flex-shrink: 0;
}
.user-card {
    display: flex; align-items: center; gap: 10px;
    padding: 10px 12px;
    background: rgba(255,255,255,0.06);
    border-radius: 9px;
}
.user-info .name { font-size: 12px; font-weight: 700; color: var(--white); }
.user-info .role { font-size: 10px; color: var(--accent); font-weight: 600; }
.avatar {
    width: 34px; height: 34px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: 12px; font-weight: 700; color: white;
    flex-shrink: 0;
}
.btn-logout {
    background: none; border: none;
    color: rgba(255,255,255,0.5);
    cursor: pointer; font-size: 16px;
    margin-left: auto; padding: 4px;
    transition: color var(--transition);
    text-decoration: none;
}
.btn-logout:hover { color: #fc8181; }

/* ── Main content ── */
.main { margin-left: var(--sidebar-width); flex: 1; display: flex; flex-direction: column; }

.topbar {
    background: var(--white);
    border-bottom: 1px solid var(--border);
    padding: 0 28px;
    height: var(--topbar-height);
    display: flex; align-items: center; gap: 16px;
    position: sticky; top: 0; z-index: 50;
    box-shadow: var(--shadow-sm);
}
.topbar h1 { font-size: 18px; font-weight: 700; color: var(--text-dark); }
.topbar-right { margin-left: auto; display: flex; align-items: center; gap: 12px; }

.content { padding: 24px 28px; flex: 1; }

/* ── Buttons ── */
.btn {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 9px 18px;
    border-radius: 8px;
    font-size: 13px; font-weight: 600;
    cursor: pointer; border: none;
    transition: all var(--transition);
    text-decoration: none;
    white-space: nowrap;
}
.btn-primary {
    background: var(--accent);
    color: var(--primary-dark);
}
.btn-primary:hover { background: var(--accent-dark); color: var(--primary-dark); }

.btn-secondary {
    background: var(--primary-mid);
    color: white;
}
.btn-secondary:hover { background: var(--primary); }

.btn-outline {
    background: white;
    color: var(--text-dark);
    border: 1.5px solid var(--border);
}
.btn-outline:hover { border-color: var(--accent); color: var(--primary-mid); }

.btn-danger { background: #fff5f5; color: var(--danger); border: 1.5px solid #feb2b2; }
.btn-danger:hover { background: #fed7d7; }

/* ── Cards ── */
.card {
    background: white;
    border-radius: var(--border-radius);
    border: 1px solid var(--border);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}
.card-head {
    background: var(--light-gray);
    border-bottom: 1px solid var(--border);
    padding: 12px 18px;
    display: flex; align-items: center; justify-content: space-between;
}
.card-head h2 {
    font-size: 13px; font-weight: 700;
    color: var(--text-dark); margin: 0;
}
.card-body { padding: 18px; }

/* ── KPI / Stat cards ── */
.kpi-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 14px;
    margin-bottom: 24px;
}
.kpi {
    background: white;
    border-radius: var(--border-radius);
    border: 1px solid var(--border);
    padding: 18px 16px;
    box-shadow: var(--shadow-sm);
    transition: box-shadow var(--transition);
}
.kpi:hover { box-shadow: var(--shadow-md); }
.kpi-icon { font-size: 22px; margin-bottom: 8px; }
.kpi-label { font-size: 11px; font-weight: 600; color: var(--text-light); text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 4px; }
.kpi-value { font-size: 22px; font-weight: 800; color: var(--text-dark); margin-bottom: 4px; }
.kpi-sub { font-size: 11px; color: var(--text-faint); }

/* ── Badges ── */
.badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 11px; font-weight: 700;
    white-space: nowrap;
}

/* ── Forms ── */
.form-group { margin-bottom: 16px; }
.form-group label {
    display: block;
    font-size: 12px; font-weight: 600;
    color: var(--text-mid);
    margin-bottom: 5px;
}
.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1.5px solid var(--border);
    border-radius: 8px;
    font-size: 13px;
    background: white;
    color: var(--text-dark);
    transition: border-color var(--transition);
    font-family: inherit;
}
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(141,198,63,0.12);
}

/* ── Tables ── */
table { width: 100%; border-collapse: collapse; }
table th {
    background: var(--primary-dark);
    color: white;
    padding: 10px 14px;
    font-size: 11px; font-weight: 700;
    text-align: left; letter-spacing: 0.4px;
}
table td {
    padding: 10px 14px;
    font-size: 13px;
    border-bottom: 1px solid #f0f4f8;
    color: var(--text-dark);
}
table tbody tr:hover { background: #f7fff2; }
table tbody tr:last-child td { border-bottom: none; }

/* ── Alerts ── */
.alert { padding: 12px 16px; border-radius: 8px; font-size: 13px; margin-bottom: 16px; }
.alert-success { background: #f0fff4; border: 1px solid #9ae6b4; color: #276749; }
.alert-error   { background: #fff5f5; border: 1px solid #feb2b2; color: var(--danger); }
.alert-warning { background: #f2ffe0; border: 1px solid #c5e88a; color: #1a3c1f; }
.alert-info    { background: #ebf8ff; border: 1px solid #90cdf4; color: #2b6cb0; }

/* ── Progress bars ── */
.progress-bar-wrap { margin-top: 8px; }
.progress-label {
    display: flex; justify-content: space-between;
    font-size: 11px; color: var(--text-light);
    margin-bottom: 4px;
}
.progress-bar {
    height: 7px; background: var(--border);
    border-radius: 4px; overflow: hidden;
}
.progress-fill {
    height: 100%; border-radius: 4px;
    background: var(--accent);
    transition: width 0.4s ease;
}

/* ── Section headers / dividers ── */
.section-title {
    font-size: 12px; font-weight: 700;
    color: var(--text-light);
    text-transform: uppercase; letter-spacing: 0.6px;
    margin-bottom: 14px;
    display: flex; align-items: center; gap: 8px;
}
.section-title::after {
    content: ''; flex: 1;
    height: 1px; background: var(--border);
}

/* ── BOQ specific ── */
.boq-section-head td {
    background: var(--primary-mid) !important;
    color: white !important;
    font-weight: 700; font-size: 12px;
    padding: 7px 12px;
}
.boq-vat-row td { background: #f0fff4 !important; color: var(--primary-mid); font-weight: 600; }
.boq-grand-row td { background: var(--primary-dark) !important; color: white; font-weight: 700; }

/* ── Quick actions (dashboard) ── */
.quick-action {
    display: flex; align-items: center; gap: 12px;
    padding: 14px 16px;
    background: white;
    border: 1.5px solid var(--border);
    border-radius: 10px;
    text-decoration: none;
    color: var(--text-dark);
    transition: all var(--transition);
    font-size: 13px;
}
.quick-action:hover {
    border-color: var(--accent);
    box-shadow: 0 4px 12px rgba(141,198,63,0.15);
    transform: translateY(-1px);
    color: var(--text-dark);
}
.qa-icon {
    width: 40px; height: 40px;
    border-radius: 10px;
    display: flex; align-items: center; justify-content: center;
    font-size: 20px; flex-shrink: 0;
}
.qa-green  { background: #f0fff4; }
.qa-amber  { background: #f2ffe0; }
.qa-blue   { background: #ebf8ff; }
.qa-purple { background: #faf5ff; }
.qa-text .title { font-size: 13px; font-weight: 700; color: var(--text-dark); }
.qa-text .sub   { font-size: 11px; color: var(--text-light); margin-top: 1px; }

/* ── Status pipeline ── */
.status-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 10px;
    margin-bottom: 24px;
}
.status-card {
    background: white;
    border-radius: 10px;
    border: 1px solid var(--border);
    padding: 14px 12px;
    display: flex; align-items: center; gap: 10px;
    box-shadow: var(--shadow-sm);
}
.status-dot {
    width: 10px; height: 10px;
    border-radius: 50%; flex-shrink: 0;
}
.status-info .num {
    font-size: 24px; font-weight: 800;
    line-height: 1;
}
.status-info .lbl {
    font-size: 11px; color: var(--text-light);
    font-weight: 600; margin-top: 2px;
}

/* ── Charts ── */
.charts-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-bottom: 20px;
}
.chart-card {
    background: white;
    border-radius: var(--border-radius);
    border: 1px solid var(--border);
    padding: 18px;
    box-shadow: var(--shadow-sm);
}
.chart-card h2 {
    font-size: 13px; font-weight: 700;
    color: var(--text-dark);
    margin-bottom: 14px;
}
.chart-wrap { height: 200px; position: relative; }

/* ── Project cards ── */
.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: 16px;
}
.project-card {
    background: white;
    border-radius: var(--border-radius);
    border: 1px solid var(--border);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    transition: box-shadow var(--transition);
}
.project-card:hover { box-shadow: var(--shadow-md); }
.project-card-top {
    padding: 14px 16px 10px;
    display: flex; align-items: flex-start; justify-content: space-between; gap: 8px;
}
.project-name { font-size: 15px; font-weight: 700; color: var(--text-dark); margin-bottom: 2px; }
.project-loc  { font-size: 12px; color: var(--text-light); }
.specs-bar {
    display: grid; grid-template-columns: repeat(4, 1fr);
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
}
.spec {
    padding: 10px 8px; text-align: center;
    border-right: 1px solid var(--border);
}
.spec:last-child { border-right: none; }
.spec-val { font-size: 14px; font-weight: 800; color: var(--text-dark); }
.spec-lbl { font-size: 10px; color: var(--text-faint); font-weight: 600; text-transform: uppercase; margin-top: 2px; }
.project-card-body { padding: 12px 16px; }
.meta-row {
    display: flex; justify-content: space-between;
    font-size: 12px; padding: 4px 0;
    border-bottom: 1px solid #f7fafc;
}
.meta-label { color: var(--text-light); }
.meta-val   { font-weight: 600; color: var(--text-dark); text-align: right; }
.project-card-foot {
    padding: 10px 16px;
    background: var(--light-gray);
    border-top: 1px solid var(--border);
    display: flex; align-items: center; justify-content: space-between;
}
.action-link {
    font-size: 12px; font-weight: 700;
    color: var(--accent-dark);
    text-decoration: none;
}
.action-link:hover { color: var(--primary); }

/* ── Login page ── */
.login-wrap {
    min-height: 100vh;
    display: flex;
}
.login-left {
    width: 420px; flex-shrink: 0;
    background: var(--primary-dark);
    padding: 48px 44px;
    display: flex; flex-direction: column;
    justify-content: space-between;
}
.login-right {
    flex: 1; padding: 48px 44px;
    display: flex; flex-direction: column;
    justify-content: center;
    max-width: 480px; margin: 0 auto;
}
.login-logo img { height: 56px; object-fit: contain; }
.login-tagline {
    font-size: 26px; font-weight: 800;
    color: white; line-height: 1.3;
    margin: 32px 0 16px;
}
.login-tagline span { color: var(--accent); }
.login-desc { font-size: 13px; color: rgba(255,255,255,0.6); line-height: 1.6; }
.feature-list { list-style: none; margin-top: 24px; }
.feature-list li {
    display: flex; align-items: center; gap: 10px;
    font-size: 13px; color: rgba(255,255,255,0.75);
    padding: 6px 0;
}
.dot {
    width: 8px; height: 8px;
    background: var(--accent);
    border-radius: 50%; flex-shrink: 0;
}
.login-right h2 { font-size: 24px; font-weight: 800; color: var(--text-dark); margin-bottom: 4px; }
.subtitle { font-size: 13px; color: var(--text-light); margin-bottom: 28px; }
.login-btn {
    width: 100%; padding: 12px;
    background: var(--accent);
    color: var(--primary-dark);
    border: none; border-radius: 9px;
    font-size: 14px; font-weight: 700;
    cursor: pointer;
    transition: background var(--transition);
}
.login-btn:hover { background: var(--accent-dark); }
.error-box {
    background: #fff5f5; border: 1px solid #feb2b2;
    color: var(--danger); padding: 10px 14px;
    border-radius: 8px; font-size: 13px;
    margin-bottom: 16px;
}

/* ── Misc utilities ── */
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.full-col { grid-column: 1 / -1; }
.text-center { text-align: center; }
.text-right  { text-align: right; }
.mt-4 { margin-top: 4px; }
.mt-8 { margin-top: 8px; }
.mt-16 { margin-top: 16px; }
.mb-16 { margin-bottom: 16px; }
.fw-700 { font-weight: 700; }
.text-green  { color: var(--primary-mid); }
.text-accent { color: var(--accent-dark); }
.text-danger { color: var(--danger); }
.text-muted  { color: var(--text-light); }

/* ── Table card ── */
.table-card {
    background: white;
    border-radius: var(--border-radius);
    border: 1px solid var(--border);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    margin-bottom: 20px;
}
.table-head-row {
    padding: 14px 18px;
    border-bottom: 1px solid var(--border);
    display: flex; align-items: center; justify-content: space-between;
}
.table-head-row h2 { font-size: 14px; font-weight: 700; margin: 0; }

/* ── Scrollbar ── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #cbd5e0; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #a0aec0; }
