/* =====================================================================
   Lujosh Properties Limited — Tenancy Management System
   Shared design tokens + per-role dashboard themes
   ===================================================================== */

:root {
    --navy: #364476;
    --navy-dark: #232E4D;
    --navy-light: #5A6FA3;
    --red: #AB323B;
    --red-dark: #7C232A;
    --white: #FFFFFF;
    --grey-bg: #F4F5F8;
    --grey-border: #E2E4EC;
    --text-main: #24262D;
    --text-muted: #6B7080;
    --success: #1D9E75;
    --warning: #BA7517;
    --danger: #AB323B;
    --radius: 10px;
    --shadow: 0 1px 3px rgba(35, 46, 77, 0.08), 0 1px 2px rgba(35, 46, 77, 0.06);
    --font: 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    font-family: var(--font);
    background: var(--grey-bg);
    color: var(--text-main);
    font-size: 15px;
}

a { color: var(--navy); text-decoration: none; }
a:hover { text-decoration: underline; }

.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 6px;
    padding: 9px 18px; border-radius: var(--radius); border: none;
    font-size: 14px; font-weight: 600; cursor: pointer; transition: opacity .15s;
}
.btn:hover { opacity: .9; text-decoration: none; }
.btn-primary { background: var(--navy); color: #fff; }
.btn-accent  { background: var(--red); color: #fff; }
.btn-outline { background: transparent; border: 1px solid var(--grey-border); color: var(--text-main); }
.btn-sm { padding: 6px 12px; font-size: 13px; }
.btn-block { width: 100%; }

.card {
    background: #fff; border-radius: 12px; border: 1px solid var(--grey-border);
    box-shadow: var(--shadow); padding: 18px 20px;
}

.form-group { margin-bottom: 16px; }
.form-group label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 6px; color: var(--text-main); }
.form-control {
    width: 100%; padding: 10px 12px; border: 1px solid var(--grey-border);
    border-radius: 8px; font-size: 14px; font-family: var(--font); background: #fff;
}
.form-control:focus { outline: none; border-color: var(--navy); box-shadow: 0 0 0 3px rgba(54,68,118,.12); }
.form-row { display: flex; gap: 14px; flex-wrap: wrap; }
.form-row .form-group { flex: 1 1 220px; }
.form-hint { font-size: 12px; color: var(--text-muted); margin-top: 4px; }

.radio-choice { display: flex; gap: 18px; margin: 8px 0 18px; }
.radio-choice label { display: flex; align-items: center; gap: 6px; font-size: 14px; font-weight: 500; cursor: pointer; }

table.table { width: 100%; border-collapse: collapse; font-size: 14px; }
table.table th { text-align: left; padding: 10px 12px; background: var(--grey-bg); color: var(--text-muted); font-size: 12px; text-transform: uppercase; letter-spacing: .03em; }
table.table td { padding: 10px 12px; border-top: 1px solid var(--grey-border); vertical-align: middle; }
table.table tr:hover td { background: #FAFBFD; }

.badge { display: inline-block; padding: 3px 10px; border-radius: 20px; font-size: 12px; font-weight: 600; }
.badge-success { background: #E1F5EE; color: #0F6E56; }
.badge-warning { background: #FAEEDA; color: #854F0B; }
.badge-danger  { background: #FCEBEB; color: #791F1F; }
.badge-neutral { background: #EEF0F5; color: #4A4E5C; }

.alert { padding: 12px 16px; border-radius: 8px; font-size: 14px; margin-bottom: 16px; }
.alert-success { background: #E1F5EE; color: #0B5A47; border: 1px solid #9FE1CB; }
.alert-danger  { background: #FCEBEB; color: #791F1F; border: 1px solid #F09595; }

.kpi-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 14px; margin-bottom: 22px; }
.kpi { background: #fff; border-radius: 12px; border: 1px solid var(--grey-border); padding: 16px 18px; }
.kpi .kpi-label { font-size: 12px; color: var(--text-muted); text-transform: uppercase; letter-spacing: .03em; }
.kpi .kpi-value { font-size: 26px; font-weight: 700; margin-top: 6px; color: var(--navy-dark); }
.kpi .kpi-value.accent { color: var(--red); }

/* ---------------- App shell ---------------- */
.app-shell { display: flex; min-height: 100vh; }
.sidebar {
    width: 240px; flex-shrink: 0; color: #fff; display: flex; flex-direction: column;
    padding: 20px 0;
}
.sidebar .brand { padding: 0 20px 20px; border-bottom: 1px solid rgba(255,255,255,.15); margin-bottom: 14px; }
.sidebar .brand img.brand-logo { height: 34px; width: auto; margin-bottom: 8px; display: block; }
.sidebar .brand strong { display: block; font-size: 16px; }
.sidebar .brand span { display: block; font-size: 11px; opacity: .75; margin-top: 2px; }
.sidebar nav a {
    display: flex; align-items: center; gap: 10px; padding: 11px 20px; color: rgba(255,255,255,.85);
    font-size: 14px; font-weight: 500; border-left: 3px solid transparent;
}
.sidebar nav a:hover, .sidebar nav a.active {
    background: rgba(255,255,255,.08); color: #fff; text-decoration: none;
    border-left-color: var(--red);
}
.sidebar .icon { width: 18px; text-align: center; }

.main { flex: 1; min-width: 0; }
.topbar {
    background: #fff; border-bottom: 1px solid var(--grey-border);
    padding: 14px 26px; display: flex; align-items: center; justify-content: space-between;
}
.topbar h1 { font-size: 19px; margin: 0; color: var(--navy-dark); }
.topbar .user-chip { display: flex; align-items: center; gap: 10px; font-size: 13px; }
.topbar .user-chip .avatar {
    width: 32px; height: 32px; border-radius: 50%; background: var(--navy); color: #fff;
    display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 13px;
}
.content { padding: 24px 26px; }

.icon-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 16px; }
.icon-tile {
    background: #fff; border-radius: 12px; border: 1px solid var(--grey-border); padding: 22px 18px;
    text-align: center; display: block; color: var(--text-main); transition: transform .12s, box-shadow .12s;
}
.icon-tile:hover { transform: translateY(-2px); box-shadow: var(--shadow); text-decoration: none; }
.icon-tile .icon-circle {
    width: 46px; height: 46px; border-radius: 50%; margin: 0 auto 10px; display: flex;
    align-items: center; justify-content: center; font-size: 20px; color: #fff;
}
.icon-tile .tile-label { font-size: 14px; font-weight: 600; }

/* ---- Role theme: ADMIN (navy chrome) ---- */
.theme-admin .sidebar { background: var(--navy); }
.theme-admin .icon-tile .icon-circle { background: var(--navy); }
.theme-admin .icon-tile:nth-child(3n) .icon-circle { background: var(--red); }

/* ---- Role theme: OFFICER (lighter navy tint) ---- */
.theme-officer .sidebar { background: var(--navy-light); }
.theme-officer .icon-tile .icon-circle { background: var(--navy-light); }
.theme-officer .icon-tile:nth-child(2n) .icon-circle { background: var(--navy); }

/* ---- Role theme: TENANT (white + red accent) ---- */
.theme-tenant .sidebar { background: var(--navy-dark); }
.theme-tenant .topbar { border-bottom: 3px solid var(--red); }
.theme-tenant .icon-tile .icon-circle { background: var(--red); }
.theme-tenant .btn-primary { background: var(--red); }

/* ---- Role theme: LANDLORD (navy/red duotone) ---- */
.theme-landlord .sidebar { background: linear-gradient(180deg, var(--navy) 0%, var(--red-dark) 100%); }
.theme-landlord .icon-tile .icon-circle { background: var(--navy); }
.theme-landlord .icon-tile:nth-child(odd) .icon-circle { background: var(--red); }

/* ---------------- Auth / login pages ---------------- */
.auth-wrap {
    min-height: 100vh; display: flex; align-items: center; justify-content: center;
    background: linear-gradient(135deg, var(--navy) 0%, var(--navy-dark) 100%);
    padding: 24px;
}
.auth-card { width: 100%; max-width: 420px; background: #fff; border-radius: 14px; padding: 34px 32px; box-shadow: 0 12px 40px rgba(0,0,0,.25); }
.auth-card .brand-lockup { text-align: center; margin-bottom: 22px; }
.auth-card .brand-lockup img.brand-logo { height: 56px; width: auto; margin-bottom: 10px; }
.auth-card .brand-lockup strong { display: block; font-size: 20px; color: var(--navy-dark); }
.auth-card .brand-lockup span { display: block; font-size: 12px; color: var(--red); font-style: italic; margin-top: 2px; }
.auth-card h2 { font-size: 16px; text-align: center; margin: 0 0 20px; color: var(--text-muted); font-weight: 500; }
.auth-links { text-align: center; margin-top: 16px; font-size: 13px; }

.portal-switch { text-align: center; margin-top: 20px; font-size: 12px; color: rgba(255,255,255,.85); }
.portal-switch a { color: #fff; text-decoration: underline; }

@media (max-width: 860px) {
    .app-shell { flex-direction: column; }
    .sidebar { width: 100%; flex-direction: row; overflow-x: auto; padding: 10px; }
    .sidebar .brand { display: none; }
    .sidebar nav { display: flex; }
    .sidebar nav a { border-left: none; border-bottom: 3px solid transparent; white-space: nowrap; }
    .sidebar nav a.active, .sidebar nav a:hover { border-bottom-color: var(--red); }
}
