/* ═══════════════════════════════════════════════════════════════════════════
   Azimuth Consultancy — Dredge Progress Portal
   azimuth.css  ·  Core stylesheet
   Modify brand colours here via CSS variables — nothing else needs changing.
   ═══════════════════════════════════════════════════════════════════════════ */

/* ── Brand tokens ─────────────────────────────────────────────────────────── */
:root {
    --navy:        #1A3A5C;
    --navy-dark:   #122840;
    --navy-light:  #244d7a;
    --steel:       #2E7D9F;
    --steel-light: #4AA8C4;
    --tint:        #EAF4F8;
    --tint-dark:   #d0e8f0;
    --white:       #FFFFFF;
    --off-white:   #F8FBFD;
    --gray-light:  #E5EEF3;
    --gray:        #8FA8BA;
    --gray-dark:   #555F6B;
    --text:        #1A2530;
    --text-muted:  #5A7080;
    --success:     #1B6B3A;
    --warning:     #7A5A00;
    --danger:      #7A1F1F;
    --sidebar-w:   260px;
    --header-h:    60px;
    --radius:      6px;
    --shadow:      0 2px 12px rgba(26,58,92,0.10);
    --shadow-lg:   0 6px 32px rgba(26,58,92,0.16);
    --font-ui:     'Segoe UI', 'Calibri', sans-serif;
    --font-mono:   'Consolas', 'Courier New', monospace;
    --transition:  0.18s ease;
}

/* ── Reset ────────────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; font-family: var(--font-ui); background: var(--off-white); color: var(--text); }
button { cursor: pointer; font-family: var(--font-ui); }
a { color: var(--steel); text-decoration: none; }
a:hover { color: var(--steel-light); }
input, select, textarea { font-family: var(--font-ui); }

/* ── Utility ──────────────────────────────────────────────────────────────── */
.hidden  { display: none !important; }
.mt-8    { margin-top: 8px; }
.mt-16   { margin-top: 16px; }
.text-muted { color: var(--text-muted); }
.text-navy  { color: var(--navy); }

/* ── Buttons ──────────────────────────────────────────────────────────────── */
.btn {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 9px 18px;
    border-radius: var(--radius);
    font-size: 13px; font-weight: 600; letter-spacing: 0.4px;
    border: 1.5px solid transparent;
    transition: all var(--transition);
    cursor: pointer;
}
.btn-primary   { background: var(--steel); color: white; border-color: var(--steel); }
.btn-primary:hover { background: var(--navy); border-color: var(--navy); }
.btn-secondary { background: white; color: var(--navy); border-color: var(--gray-light); }
.btn-secondary:hover { border-color: var(--steel); color: var(--steel); }
.btn-danger    { background: #f8e8e8; color: var(--danger); border-color: #e8c0c0; }
.btn-danger:hover { background: var(--danger); color: white; }
.btn-sm { padding: 5px 12px; font-size: 12px; }
.btn-full { width: 100%; justify-content: center; padding: 12px; font-size: 14px; }

/* ── Form elements ────────────────────────────────────────────────────────── */
.form-group { margin-bottom: 20px; }
.form-label {
    display: block;
    font-size: 11px; font-weight: 600;
    letter-spacing: 1.2px; text-transform: uppercase;
    color: var(--gray-dark); margin-bottom: 7px;
}
.form-control {
    width: 100%; padding: 10px 14px;
    border: 1.5px solid var(--gray-light);
    border-radius: var(--radius);
    font-size: 14px; color: var(--text);
    background: var(--off-white);
    transition: border-color var(--transition), box-shadow var(--transition);
    outline: none;
}
.form-control:focus {
    border-color: var(--steel);
    box-shadow: 0 0 0 3px rgba(46,125,159,0.15);
    background: white;
}
.form-error {
    background: #fdf0f0; border: 1px solid #e8b4b4;
    color: var(--danger); border-radius: var(--radius);
    padding: 10px 14px; font-size: 13px; margin-bottom: 16px;
}

/* ── Tables ───────────────────────────────────────────────────────────────── */
.az-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.az-table th {
    background: var(--navy); color: white;
    padding: 10px 14px; text-align: left;
    font-size: 11px; letter-spacing: 0.8px; text-transform: uppercase;
    font-weight: 600;
}
.az-table td { padding: 10px 14px; border-bottom: 1px solid var(--gray-light); }
.az-table tr:nth-child(even) td { background: var(--tint); }
.az-table tr:hover td { background: var(--tint-dark); }

/* ── Cards ────────────────────────────────────────────────────────────────── */
.card {
    background: white; border-radius: 10px;
    border: 1px solid var(--gray-light);
    box-shadow: var(--shadow); overflow: hidden;
}
.card-header {
    padding: 14px 20px;
    background: var(--navy); color: white;
    font-size: 13px; font-weight: 600; letter-spacing: 0.3px;
    border-bottom: 2px solid var(--steel);
    display: flex; align-items: center; justify-content: space-between;
}
.card-body { padding: 20px; }

/* ── Badges ───────────────────────────────────────────────────────────────── */
.badge {
    display: inline-block; padding: 2px 9px;
    border-radius: 12px; font-size: 10px;
    font-weight: 700; letter-spacing: 0.5px; text-transform: uppercase;
}
.badge-steel   { background: var(--steel); color: white; }
.badge-success { background: #d4edda; color: var(--success); }
.badge-warning { background: #fff3cd; color: var(--warning); }
.badge-danger  { background: #f8e8e8; color: var(--danger); }
.badge-gray    { background: var(--gray-light); color: var(--gray-dark); }

/* ── App shell ────────────────────────────────────────────────────────────── */
.app-shell { display: flex; flex-direction: column; height: 100vh; overflow: hidden; }

/* ── Header ───────────────────────────────────────────────────────────────── */
.app-header {
    height: var(--header-h);
    background: var(--navy);
    border-bottom: 2px solid var(--steel);
    display: flex; align-items: center;
    padding: 0 20px; gap: 16px;
    flex-shrink: 0; z-index: 1000;
    box-shadow: 0 2px 8px rgba(0,0,0,0.25);
}
.header-brand {
    display: flex; align-items: center; gap: 12px;
    text-decoration: none; flex-shrink: 0;
}
.brand-mark {
    width: 36px; height: 36px;
    background: var(--steel); border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: 14px; font-weight: 700; color: white;
}
.brand-name    { font-size: 14px; font-weight: 600; color: white; letter-spacing: 0.3px; }
.brand-tagline { font-size: 10px; color: var(--steel-light); letter-spacing: 1px; text-transform: uppercase; }
.header-sep    { width: 1px; height: 28px; background: rgba(255,255,255,0.12); margin: 0 4px; }

.header-nav { display: flex; gap: 4px; }
.nav-link {
    padding: 6px 14px; border-radius: var(--radius);
    color: rgba(255,255,255,0.7); font-size: 13px;
    background: transparent; border: 1px solid transparent;
    transition: all var(--transition); cursor: pointer;
    text-decoration: none; display: inline-flex; align-items: center; gap: 6px;
}
.nav-link:hover  { background: rgba(255,255,255,0.08); color: white; }
.nav-link.active {
    background: rgba(46,125,159,0.25);
    border-color: rgba(74,168,196,0.4);
    color: var(--steel-light);
}
.header-right { display: flex; align-items: center; gap: 12px; margin-left: auto; }
.user-badge {
    display: flex; align-items: center; gap: 8px;
    padding: 5px 12px 5px 8px;
    background: rgba(255,255,255,0.08);
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: 20px;
}
.user-avatar {
    width: 26px; height: 26px;
    background: var(--steel); border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: 11px; font-weight: 700; color: white;
}
.user-name { font-size: 13px; color: rgba(255,255,255,0.85); }

/* ── Body + sidebar ───────────────────────────────────────────────────────── */
.app-body { display: flex; flex: 1; overflow: hidden; }
.sidebar {
    width: var(--sidebar-w); background: white;
    border-right: 1px solid var(--gray-light);
    display: flex; flex-direction: column;
    flex-shrink: 0; overflow-y: auto;
    box-shadow: 2px 0 8px rgba(26,58,92,0.06);
}
.sidebar-section { padding: 16px 0; border-bottom: 1px solid var(--gray-light); }
.sidebar-label {
    padding: 0 16px 8px;
    font-size: 10px; font-weight: 700;
    letter-spacing: 1.5px; text-transform: uppercase;
    color: var(--gray);
}
.sidebar-item {
    display: flex; align-items: center; gap: 10px;
    padding: 9px 16px; font-size: 13.5px;
    color: var(--gray-dark); cursor: pointer;
    transition: all var(--transition);
    border-left: 3px solid transparent;
    text-decoration: none;
}
.sidebar-item:hover  { background: var(--tint); color: var(--navy); border-left-color: var(--steel-light); }
.sidebar-item.active { background: var(--tint); color: var(--navy); border-left-color: var(--steel); font-weight: 600; }
.sidebar-icon { width: 18px; text-align: center; }

.main-content { flex: 1; overflow-y: auto; padding: 28px; }

/* ── Map page layout ──────────────────────────────────────────────────────── */
.map-page { flex: 1; display: flex; flex-direction: column; overflow: hidden; min-height: 0; }
.map-toolbar {
    height: 46px; background: white;
    border-bottom: 1px solid var(--gray-light);
    display: flex; align-items: center;
    padding: 0 16px; gap: 8px; flex-shrink: 0;
    box-shadow: 0 1px 4px rgba(26,58,92,0.06);
}
.toolbar-sep   { width: 1px; height: 24px; background: var(--gray-light); margin: 0 6px; }
.tool-btn {
    padding: 5px 12px;
    border: 1.5px solid var(--gray-light);
    border-radius: var(--radius);
    background: white; color: var(--gray-dark);
    font-size: 12px; font-weight: 500;
    transition: all var(--transition);
    display: flex; align-items: center; gap: 5px;
}
.tool-btn:hover  { border-color: var(--steel); color: var(--steel); background: var(--tint); }
.tool-btn.active { background: var(--steel); border-color: var(--steel); color: white; }

#mapContainer { flex: 1; min-height: 0; position: relative; }

.map-legend {
    position: absolute; bottom: 32px; right: 12px;
    background: rgba(255,255,255,0.94);
    border: 1px solid var(--gray-light);
    border-radius: var(--radius);
    padding: 12px; z-index: 1000;
    box-shadow: var(--shadow); min-width: 130px;
}
.legend-title  { font-size: 10px; font-weight: 700; letter-spacing: 1px; text-transform: uppercase; color: var(--gray-dark); margin-bottom: 8px; }
.legend-bar    { width: 16px; height: 140px; border-radius: 3px; float: left; margin-right: 8px; }
.legend-ticks  { float: left; display: flex; flex-direction: column; justify-content: space-between; height: 140px; font-size: 10px; font-family: var(--font-mono); }
.legend-footer { clear: both; padding-top: 8px; font-size: 10px; color: var(--text-muted); }

.map-coords {
    position: absolute; bottom: 10px; left: 50%; transform: translateX(-50%);
    background: rgba(26,42,64,0.82); color: rgba(255,255,255,0.9);
    padding: 4px 14px; border-radius: 12px;
    font-size: 11px; font-family: var(--font-mono);
    z-index: 1000; pointer-events: none;
}
.stats-bar {
    background: var(--navy-dark, #122840);
    color: rgba(255,255,255,0.85);
    padding: 6px 16px; display: flex; gap: 24px;
    font-size: 11px; font-family: var(--font-mono);
    flex-shrink: 0; flex-wrap: wrap;
}
.stat-lbl { color: var(--steel-light); font-weight: 600; margin-right: 5px; }

/* ── Login page ───────────────────────────────────────────────────────────── */
.login-page {
    min-height: 100vh; display: flex;
    background: linear-gradient(135deg, var(--navy-dark) 0%, var(--navy) 45%, var(--navy-light) 100%);
    position: relative; overflow: hidden;
}
.login-page::before {
    content: '';
    position: absolute; inset: 0;
    background-image:
        linear-gradient(rgba(255,255,255,0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255,255,255,0.03) 1px, transparent 1px);
    background-size: 40px 40px;
}
.login-panel {
    margin: auto; width: 420px;
    background: white; border-radius: 12px;
    box-shadow: 0 24px 80px rgba(0,0,0,0.35);
    overflow: hidden; position: relative; z-index: 1;
}
.login-header {
    background: var(--navy); padding: 32px 40px 24px;
    text-align: center; border-bottom: 3px solid var(--steel);
}
.login-logo  { font-size: 11px; letter-spacing: 4px; color: var(--steel-light); text-transform: uppercase; margin-bottom: 8px; }
.login-title { font-size: 22px; color: white; font-weight: 400; }
.login-sub   { font-size: 12px; color: var(--gray); margin-top: 6px; }
.login-body  { padding: 36px 40px 28px; }
.login-foot  { padding: 14px 40px; background: var(--tint); border-top: 1px solid var(--gray-light); font-size: 11px; color: var(--text-muted); text-align: center; }

/* ── Dashboard project cards ──────────────────────────────────────────────── */
.dash-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px,1fr)); gap: 20px; }
.project-card {
    background: white; border-radius: 10px;
    border: 1px solid var(--gray-light);
    overflow: hidden; cursor: pointer;
    transition: all var(--transition);
    box-shadow: var(--shadow); text-decoration: none; display: block;
}
.project-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); border-color: var(--steel-light); }
.card-thumb {
    height: 120px;
    background: linear-gradient(135deg, var(--navy) 0%, var(--steel) 100%);
    position: relative; overflow: hidden;
}
.card-thumb-label {
    position: absolute; bottom: 8px; right: 10px;
    font-size: 10px; color: rgba(255,255,255,0.7);
    font-family: var(--font-mono);
}
.card-body  { padding: 16px; }
.card-title { font-size: 15px; font-weight: 600; color: var(--navy); }
.card-meta  { font-size: 12px; color: var(--text-muted); margin-top: 4px; }
.card-stats { display: flex; gap: 16px; margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--gray-light); }
.card-stat  { font-size: 11px; color: var(--text-muted); }
.card-stat strong { display: block; font-size: 14px; color: var(--navy); }

/* ── Toast notification ───────────────────────────────────────────────────── */
#azToast {
    position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%);
    background: var(--navy-dark, #122840); color: white;
    padding: 11px 22px; border-radius: 24px;
    font-size: 13px; box-shadow: var(--shadow-lg);
    z-index: 9999; opacity: 0;
    transition: opacity 0.3s; pointer-events: none;
}
#azToast.show { opacity: 1; }

/* ── Responsive ───────────────────────────────────────────────────────────── */
@media (max-width: 768px) {
    :root { --sidebar-w: 100%; }
    .app-body { flex-direction: column; }
    .sidebar { width: 100%; border-right: none; border-bottom: 1px solid var(--gray-light); max-height: 200px; }
    .header-nav { display: none; }
    .brand-tagline { display: none; }
}
