:root {
  --teal: #1D9E75; --teal2: #0F6E56; --teal3: #085041;
  --teal-light: #E1F5EE; --teal-mid: #5DCAA5;
  --navy: #0B1F3A; --navy2: #132848;
  --amber: #EF9F27; --amber-light: #FEF3C7;
  --red: #E24B4A; --red-light: #FCEBEB;
  --blue-light: #E6F1FB; --blue: #185FA5;
  --gray-bg: #F7F8FA; --border: rgba(0,0,0,0.1);
  --text: #1a1a1a; --text2: #555; --text3: #888;
  --white: #ffffff;
  --radius: 8px; --radius-lg: 12px;
  --sidebar-w: 220px;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: 'Inter', -apple-system, sans-serif; font-size: 14px; color: var(--text); background: var(--gray-bg); line-height: 1.5; }
.hidden { display: none !important; }

/* ── AUTH SCREENS ── */
.auth-bg { min-height: 100vh; background: var(--gray-bg); display: flex; align-items: center; justify-content: center; padding: 1.5rem; }
.auth-card { background: var(--white); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 2rem; width: 100%; max-width: 440px; }
.brand-row { display: flex; align-items: center; gap: 10px; margin-bottom: 1.75rem; }
.brand-icon { width: 40px; height: 40px; border-radius: var(--radius); background: var(--teal); display: flex; align-items: center; justify-content: center; }
.brand-icon i { color: var(--teal-light); font-size: 22px; }
.brand-name { font-size: 18px; font-weight: 600; color: var(--text); }
.brand-sub { font-size: 11px; color: var(--text3); }
.form-group { margin-bottom: 14px; }
.form-label { display: flex; justify-content: space-between; align-items: center; font-size: 12px; font-weight: 500; color: var(--text2); margin-bottom: 5px; }
.form-input { width: 100%; padding: 9px 12px; border: 1px solid var(--border); border-radius: var(--radius); font-size: 13px; color: var(--text); background: var(--white); font-family: inherit; transition: border-color .15s; }
.form-input:focus { outline: none; border-color: var(--teal); box-shadow: 0 0 0 3px var(--teal-light); }
.input-wrap { position: relative; }
.input-wrap .form-input { padding-left: 36px; }
.input-icon { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); color: var(--text3); font-size: 16px; pointer-events: none; }
.input-icon-r { position: absolute; right: 11px; top: 50%; transform: translateY(-50%); color: var(--text3); font-size: 16px; cursor: pointer; }
.btn { display: inline-flex; align-items: center; gap: 5px; padding: 8px 16px; border-radius: var(--radius); font-size: 13px; font-weight: 500; cursor: pointer; border: 1px solid var(--border); background: var(--white); color: var(--text); transition: all .12s; font-family: inherit; }
.btn:hover { background: var(--gray-bg); }
.btn:active { transform: scale(0.98); }
.btn-full { width: 100%; justify-content: center; }
.btn-teal { background: var(--teal); color: var(--teal-light); border-color: var(--teal); }
.btn-teal:hover { background: var(--teal2); }
.btn-sm { padding: 5px 11px; font-size: 12px; }
.btn-ghost { border-color: transparent; background: transparent; color: var(--teal); font-size: 12px; padding: 2px 0; }
.btn-ghost:hover { background: transparent; text-decoration: underline; }
.btn-outline-teal { background: var(--teal-light); border-color: var(--teal-mid); color: var(--teal3); }
.btn-outline-teal:hover { background: #c8eed9; }
.btn-danger { background: var(--red-light); border-color: #F09595; color: #A32D2D; }
.btn-warn { background: var(--amber-light); border-color: var(--amber); color: #633806; }
.divider { border: none; border-top: 1px solid var(--border); margin: 1.25rem 0; }
.text-center { text-align: center; }
.text-sm { font-size: 12px; color: var(--text2); }
.text-muted { color: var(--text3); }
.alert { border-radius: var(--radius); padding: 10px 13px; font-size: 12px; margin-bottom: 10px; display: flex; align-items: flex-start; gap: 8px; line-height: 1.5; }
.alert i { font-size: 16px; flex-shrink: 0; margin-top: 1px; }
.alert-success { background: var(--teal-light); color: var(--teal3); border: 1px solid var(--teal-mid); }
.alert-error { background: var(--red-light); color: #791F1F; border: 1px solid #F09595; }
.alert-info { background: var(--blue-light); color: #0C447C; border: 1px solid #85B7EB; }
.alert-warn { background: var(--amber-light); color: #633806; border: 1px solid var(--amber); }

/* ── OTP ── */
.otp-row { display: flex; gap: 8px; justify-content: center; margin: 1rem 0; }
.otp-input { width: 46px; height: 52px; border: 1px solid var(--border); border-radius: var(--radius); font-size: 22px; font-weight: 600; text-align: center; color: var(--text); background: var(--white); }
.otp-input:focus { outline: none; border-color: var(--teal); box-shadow: 0 0 0 3px var(--teal-light); }

/* ── PASSWORD STRENGTH ── */
.pw-strength { margin-top: 6px; }
.pw-bar-wrap { height: 4px; background: var(--border); border-radius: 2px; overflow: hidden; }
.pw-bar-fill { height: 100%; border-radius: 2px; transition: width .3s, background .3s; }

/* ── STEPS ── */
.steps-row { display: flex; align-items: center; margin-bottom: 1.5rem; }
.step-node { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.step-circle { width: 28px; height: 28px; border-radius: 50%; border: 1.5px solid var(--border); display: flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 500; background: var(--white); color: var(--text3); }
.step-circle.done { background: var(--teal); border-color: var(--teal); color: var(--teal-light); }
.step-circle.active { border-color: var(--teal); color: var(--teal); }
.step-label { font-size: 10px; color: var(--text3); white-space: nowrap; }
.step-label.active { color: var(--text); font-weight: 500; }
.step-label.done { color: var(--teal2); }
.step-line { flex: 1; height: 1px; background: var(--border); margin: 0 4px; margin-bottom: 14px; }
.step-line.done { background: var(--teal); }

/* ── DASHBOARD LAYOUT ── */
.dash-layout { display: grid; grid-template-columns: var(--sidebar-w) 1fr; min-height: 100vh; }
.sidebar { background: var(--white); border-right: 1px solid var(--border); display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.sidebar-brand { padding: .875rem 1.1rem; border-bottom: 1px solid var(--border); display: flex; align-items: center; gap: 8px; }
.sidebar-logo { width: 32px; height: 32px; border-radius: 6px; background: var(--teal); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.sidebar-logo i { color: var(--teal-light); font-size: 18px; }
.sidebar-title { font-size: 14px; font-weight: 600; color: var(--text); }
.sidebar-subtitle { font-size: 10px; color: var(--text3); }
.nav-section { font-size: 9px; font-weight: 600; color: var(--text3); text-transform: uppercase; letter-spacing: .06em; padding: 0 1.1rem; margin: 10px 0 3px; }
.nav-item { display: flex; align-items: center; gap: 9px; padding: 8px 1.1rem; font-size: 12px; color: var(--text2); cursor: pointer; border-left: 2px solid transparent; transition: all .1s; user-select: none; }
.nav-item:hover { background: var(--gray-bg); color: var(--text); }
.nav-item.active { background: var(--teal-light); color: var(--teal3); border-left-color: var(--teal); font-weight: 500; }
.nav-item i { font-size: 16px; flex-shrink: 0; }
.nav-badge { margin-left: auto; font-size: 9px; padding: 1px 5px; border-radius: 99px; background: var(--red); color: #fff; font-weight: 600; }
.sidebar-footer { margin-top: auto; padding: .875rem 1.1rem; border-top: 1px solid var(--border); }
.user-pill { display: flex; align-items: center; gap: 8px; }
.user-avatar { width: 30px; height: 30px; border-radius: 50%; background: var(--blue-light); display: flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 600; color: var(--blue); flex-shrink: 0; }
.user-name { font-size: 12px; font-weight: 500; }
.user-role { font-size: 10px; color: var(--text3); }
.main-area { display: flex; flex-direction: column; min-width: 0; min-height: 100vh; overflow-y: auto; }
.topbar { background: var(--white); border-bottom: 1px solid var(--border); padding: 0 1.25rem; height: 56px; display: flex; align-items: center; justify-content: space-between; position: sticky; top: 0; z-index: 10; position: relative; }
.topbar-title { font-size: 14px; font-weight: 600; color: var(--text); }
.page-content { padding: 1.25rem; flex: 1; }

/* ── CARDS ── */
.card { background: var(--white); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 1rem 1.25rem; margin-bottom: .875rem; }
.card-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: .875rem; }
.card-title { font-size: 13px; font-weight: 600; color: var(--text); }
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 10px; margin-bottom: 1rem; }
.stat-card { background: var(--gray-bg); border-radius: var(--radius); padding: 12px; }
.stat-val { font-size: 22px; font-weight: 600; color: var(--text); }
.stat-lbl { font-size: 10px; color: var(--text3); margin-top: 2px; }
.stat-delta { font-size: 10px; margin-top: 4px; }
.prog-bar { height: 4px; background: var(--border); border-radius: 2px; overflow: hidden; margin-top: 5px; }
.prog-fill { height: 100%; border-radius: 2px; background: var(--teal); }

/* ── TABLES ── */
.table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius-lg); }
table { width: 100%; border-collapse: collapse; font-size: 12px; }
th { background: var(--gray-bg); padding: 7px 10px; text-align: left; font-weight: 600; border-bottom: 1px solid var(--border); color: var(--text2); font-size: 11px; white-space: nowrap; }
td { padding: 7px 10px; border-bottom: 1px solid var(--border); color: var(--text); }
tr:last-child td { border-bottom: none; }
tr:hover td { background: #fafafa; }

/* ── BADGES ── */
.badge { display: inline-flex; align-items: center; gap: 3px; font-size: 10px; padding: 2px 8px; border-radius: 99px; border: 1px solid; white-space: nowrap; font-weight: 500; }
.b-green { background: var(--teal-light); color: var(--teal3); border-color: var(--teal-mid); }
.b-amber { background: var(--amber-light); color: #633806; border-color: var(--amber); }
.b-red { background: var(--red-light); color: #A32D2D; border-color: #F09595; }
.b-blue { background: var(--blue-light); color: #0C447C; border-color: #85B7EB; }
.b-gray { background: var(--gray-bg); color: var(--text2); border-color: var(--border); }
.b-gold { background: #FEF3C7; color: #633806; border-color: var(--amber); }
.b-purple { background: #EEEDFE; color: #3C3489; border-color: #AFA9EC; }

/* ── FORMS ── */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 10px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.fg { margin-bottom: 10px; }
select.form-input option { color: var(--text); }

/* ── UPLOAD ZONE ── */
.upload-drop { border: 2px dashed var(--border); border-radius: var(--radius-lg); padding: 2rem; text-align: center; cursor: pointer; transition: all .15s; }
.upload-drop:hover, .upload-drop.drag { border-color: var(--teal); background: var(--teal-light); }
.upload-drop i { font-size: 32px; color: var(--text3); display: block; margin-bottom: 10px; }
.upload-drop h3 { font-size: 14px; font-weight: 600; margin-bottom: 4px; }
.upload-drop p { font-size: 12px; color: var(--text2); margin-bottom: 12px; }

/* ── GREEN LIGHT ── */
@keyframes pulseRing { 0% { transform: scale(1); opacity: .5; } 70% { transform: scale(1.55); opacity: 0; } 100% { opacity: 0; } }
@keyframes checkDraw { 0% { stroke-dashoffset: 52; } 100% { stroke-dashoffset: 0; } }
@keyframes fadeUp { 0% { opacity: 0; transform: translateY(8px); } 100% { opacity: 1; transform: translateY(0); } }
.clearance-wrap { background: var(--teal-light); border: 2px solid var(--teal); border-radius: var(--radius-lg); padding: 1.75rem; text-align: center; animation: fadeUp .4s ease both; }
.gl-outer { position: relative; width: 72px; height: 72px; margin: 0 auto 1rem; display: flex; align-items: center; justify-content: center; }
.gl-ring { position: absolute; inset: 0; border-radius: 50%; border: 2.5px solid var(--teal); animation: pulseRing 2s ease-out infinite; }
.gl-ring2 { position: absolute; inset: 0; border-radius: 50%; border: 2.5px solid var(--teal); animation: pulseRing 2s ease-out .55s infinite; }
.gl-circle { width: 72px; height: 72px; border-radius: 50%; background: var(--teal); display: flex; align-items: center; justify-content: center; position: relative; z-index: 1; }
.gl-check { stroke: var(--teal-light); stroke-width: 3.5; stroke-linecap: round; stroke-linejoin: round; fill: none; stroke-dasharray: 52; stroke-dashoffset: 52; animation: checkDraw .5s ease .2s forwards; }
.clearance-title { font-size: 18px; font-weight: 600; color: var(--teal3); margin-bottom: 4px; }
.clearance-meta { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 8px; margin: 1rem 0; }
.cm-card { background: var(--white); border: 1px solid var(--teal-mid); border-radius: var(--radius); padding: 10px; text-align: center; }
.cm-val { font-size: 18px; font-weight: 600; color: var(--teal3); }
.cm-lbl { font-size: 10px; color: var(--teal2); margin-top: 2px; }

/* ── CONTRIBUTION BARS ── */
.contrib-row { display: grid; grid-template-columns: 200px 1fr 100px 55px; gap: 8px; align-items: center; padding: 6px 0; border-bottom: 1px solid var(--border); font-size: 12px; }
.contrib-row:last-child { border-bottom: none; }
.contrib-bar-bg { background: var(--gray-bg); border-radius: 3px; height: 10px; overflow: hidden; }
.contrib-bar-fill { height: 100%; border-radius: 3px; }

/* ── WORK ORDERS ── */
.wo-item { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--border); }
.wo-item:last-child { border-bottom: none; }
.wo-dot { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }

/* ── LOGO UPLOAD ── */
.logo-box { width: 100%; height: 80px; border: 2px dashed var(--border); border-radius: var(--radius); display: flex; align-items: center; justify-content: center; flex-direction: column; gap: 5px; cursor: pointer; color: var(--text3); font-size: 12px; transition: all .12s; }
.logo-box:hover { border-color: var(--teal); color: var(--teal); }
.logo-box i { font-size: 22px; }
.logo-preview { width: 100%; height: 80px; border: 1px solid var(--border); border-radius: var(--radius); display: flex; align-items: center; justify-content: center; background: var(--gray-bg); gap: 8px; font-size: 13px; font-weight: 500; }

/* ── MISC ── */
.row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.flex-between { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 8px; }
.page-title { font-size: 18px; font-weight: 600; margin-bottom: 1rem; }
.section-label { font-size: 11px; font-weight: 600; color: var(--text2); text-transform: uppercase; letter-spacing: .05em; margin: 1rem 0 8px; }
.icon-btn { width: 32px; height: 32px; border-radius: var(--radius); border: 1px solid var(--border); background: var(--white); display: flex; align-items: center; justify-content: center; cursor: pointer; position: relative; }
.icon-btn:hover { background: var(--gray-bg); }
.notif-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--red); position: absolute; top: 2px; right: 2px; }
.report-fmt-btn { padding: 6px 12px; border-radius: var(--radius); font-size: 12px; font-weight: 500; cursor: pointer; border: 1px solid var(--border); background: var(--white); color: var(--text2); display: inline-flex; align-items: center; gap: 5px; transition: all .12s; }
.report-fmt-btn.selected { background: var(--teal-light); border-color: var(--teal-mid); color: var(--teal3); }
.activity-item { display: flex; align-items: flex-start; gap: 10px; padding: 7px 0; border-bottom: 1px solid var(--border); }
.activity-item:last-child { border-bottom: none; }
.act-icon { width: 26px; height: 26px; border-radius: 50%; display: flex; align-items: center; justify-content: center; flex-shrink: 0; font-size: 13px; }
.spinner { display: inline-block; width: 14px; height: 14px; border: 2px solid currentColor; border-top-color: transparent; border-radius: 50%; animation: spin .6s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* Messaging animations */
@keyframes slideInRight {
  from { transform: translateX(100%); opacity: 0; }
  to   { transform: translateX(0);    opacity: 1; }
}
