/* ==========================================================================
   Avreiðingar — application theme
   A refined sea / teal-blue palette for a Faroese seafood settlement app.
   ========================================================================== */

:root {
    /* Brand / sea palette */
    --sea-900: #082f38;
    --sea-800: #0d4d5c;
    --sea-700: #11606f;
    --sea-600: #167b8c;
    --sea-500: #2f9fb0;
    --sea-400: #5fd0c4;
    --sea-300: #9be7dd;

    --accent: #f0a92b;      /* warm contrast for highlights / focus */
    --accent-dark: #d98e12;

    /* Neutrals */
    --ink: #16242a;
    --ink-soft: #4a5b62;
    --muted: #7c8a90;
    --line: #e3e9ec;
    --line-soft: #eef2f4;
    --surface: #ffffff;
    --canvas: #f4f7f8;

    --ok: #2e9e6b;
    --ok-bg: #d9f3e6;
    --err: #cc4b4b;
    --err-bg: #fae0e0;

    --radius: 12px;
    --radius-sm: 8px;
    --shadow-sm: 0 1px 2px rgba(8, 47, 56, .06), 0 1px 3px rgba(8, 47, 56, .08);
    --shadow-md: 0 4px 16px rgba(8, 47, 56, .08), 0 1px 4px rgba(8, 47, 56, .06);

    --sidebar-w: 252px;
}

/* --------------------------------------------------------------------------
   Base
   -------------------------------------------------------------------------- */
html { font-size: 15px; }

body {
    font-family: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    color: var(--ink);
    background: var(--canvas);
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

h1, h2, h3, h4, h5, h6 { font-weight: 650; letter-spacing: -.01em; color: var(--ink); }

main h1 { font-size: 1.55rem; margin-bottom: 1.1rem; }
main h2 { font-size: 1.25rem; }

a { color: var(--sea-600); text-decoration: none; }
a:hover { color: var(--sea-700); }

.text-muted { color: var(--muted) !important; }

/* Inline SVG icon helper — matches the Bootstrap Icons weight/size and
   inherits the surrounding text colour via currentColor. */
.svg-icon {
    display: inline-block;
    width: 1em;
    height: 1em;
    vertical-align: -0.125em;
    fill: currentColor;
    flex: none;
}
.sidebar-nav .nav-link .svg-icon { width: 1rem; height: 1rem; }

/* --------------------------------------------------------------------------
   App shell layout
   -------------------------------------------------------------------------- */
.app-shell { min-height: 100vh; }

/* --------------------------------------------------------------------------
   Sidebar
   -------------------------------------------------------------------------- */
.sidebar {
    width: var(--sidebar-w);
    min-height: 100vh;
    background: linear-gradient(180deg, var(--sea-800) 0%, var(--sea-900) 100%);
    color: #cfe3e7;
    padding: 0;
    position: sticky;
    top: 0;
    align-self: flex-start;
    display: flex;
    flex-direction: column;
}

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: .65rem;
    padding: 1.05rem 1.15rem;
    border-bottom: 1px solid rgba(255, 255, 255, .08);
}

.sidebar-brand img { width: 34px; height: 34px; border-radius: 9px; flex: none; }

.sidebar-brand .brand-name {
    font-weight: 650;
    font-size: 1.02rem;
    color: #fff;
    line-height: 1.15;
    letter-spacing: -.01em;
}

.sidebar-brand .brand-sub {
    display: block;
    font-size: .68rem;
    font-weight: 500;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: var(--sea-400);
}

.sidebar-nav {
    list-style: none;
    margin: 0;
    padding: .75rem .65rem 1.25rem;
    overflow-y: auto;
    flex: 1 1 auto;
}

.sidebar-nav .nav-section {
    font-size: .67rem;
    font-weight: 700;
    letter-spacing: .09em;
    text-transform: uppercase;
    color: var(--sea-400);
    padding: .35rem .65rem;
    margin-top: .85rem;
}
.sidebar-nav .nav-section:first-child { margin-top: 0; }

.sidebar-nav .nav-item { margin: 0; }

.sidebar-nav .nav-link {
    display: flex;
    align-items: center;
    gap: .6rem;
    padding: .42rem .65rem;
    border-radius: var(--radius-sm);
    color: #c6dde1;
    font-size: .9rem;
    line-height: 1.2;
    transition: background .12s ease, color .12s ease;
}

.sidebar-nav .nav-link i { font-size: 1rem; width: 1.1rem; text-align: center; color: var(--sea-400); transition: color .12s ease; }
.sidebar-nav .nav-link .svg-icon { color: var(--sea-400); transition: color .12s ease; }
.sidebar-nav .nav-link:hover .svg-icon,
.sidebar-nav .nav-link.active .svg-icon { color: var(--sea-300); }

.sidebar-nav .nav-link:hover {
    background: rgba(255, 255, 255, .07);
    color: #fff;
}
.sidebar-nav .nav-link:hover i { color: var(--sea-300); }

.sidebar-nav .nav-link.active {
    background: rgba(95, 208, 196, .16);
    color: #fff;
    font-weight: 600;
}
.sidebar-nav .nav-link.active i { color: var(--sea-300); }

/* --------------------------------------------------------------------------
   Top header bar
   -------------------------------------------------------------------------- */
.app-main { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; }

.app-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    background: var(--surface);
    border-bottom: 1px solid var(--line);
    padding: .7rem 1.5rem;
    position: sticky;
    top: 0;
    z-index: 1020;
}

.app-header .page-title {
    font-size: 1.02rem;
    font-weight: 650;
    margin: 0;
    color: var(--ink);
}

.app-header .header-right {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: .9rem;
}

.tenant-chip {
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    background: var(--sea-300);
    color: var(--sea-900);
    font-size: .78rem;
    font-weight: 600;
    padding: .28rem .7rem;
    border-radius: 999px;
}

.tenant-chip i { font-size: .85rem; }

.user-info { display: flex; align-items: center; gap: .55rem; }

.user-avatar {
    width: 30px; height: 30px;
    border-radius: 50%;
    background: var(--sea-600);
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: .8rem;
    font-weight: 600;
}

.user-name { font-size: .85rem; color: var(--ink-soft); }

.app-content { padding: 1.6rem 1.5rem; }

/* --------------------------------------------------------------------------
   Cards
   -------------------------------------------------------------------------- */
.card {
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    background: var(--surface);
}

.card-header {
    background: var(--surface);
    border-bottom: 1px solid var(--line);
    font-weight: 600;
    color: var(--ink);
    padding: .8rem 1.1rem;
    border-radius: var(--radius) var(--radius) 0 0 !important;
}

.card-body { padding: 1.1rem; }

/* --------------------------------------------------------------------------
   Tables (incl. inline-grid used by the CRUD pages)
   -------------------------------------------------------------------------- */
.table {
    background: var(--surface);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--line);
    color: var(--ink);
    margin-bottom: 1rem;
}

.table > thead > tr > th {
    background: var(--line-soft);
    color: var(--ink-soft);
    font-size: .72rem;
    font-weight: 700;
    letter-spacing: .04em;
    text-transform: uppercase;
    border-bottom: 1px solid var(--line);
    padding: .6rem .7rem;
    vertical-align: middle;
    white-space: nowrap;
}

.table > tbody > tr > td {
    padding: .45rem .7rem;
    vertical-align: middle;
    border-top: 1px solid var(--line-soft);
}

.table-striped > tbody > tr:nth-of-type(odd) > td { background: #fbfcfd; }

.table tbody tr { transition: background .1s ease; }
.table-hover > tbody > tr:hover > td,
.table tbody tr:hover > td { background: #eef7f8; }

/* inline-grid: keep the class working for inline-grid.js, just refine spacing */
.table.inline-grid > tbody > tr > td { padding: .3rem .45rem; }

.table.inline-grid .form-control,
.table.inline-grid .form-select {
    border-color: transparent;
    background: transparent;
    box-shadow: none;
    border-radius: var(--radius-sm);
    transition: background .12s ease, border-color .12s ease, box-shadow .12s ease;
}

.table.inline-grid .form-control:hover,
.table.inline-grid .form-select:hover { background: #f1f6f7; }

.table.inline-grid .form-control:focus,
.table.inline-grid .form-select:focus {
    background: #fff;
    border-color: var(--sea-500);
    box-shadow: 0 0 0 2px rgba(47, 159, 176, .2);
}

/* --------------------------------------------------------------------------
   Forms
   -------------------------------------------------------------------------- */
.form-label {
    font-size: .8rem;
    font-weight: 600;
    color: var(--ink-soft);
    margin-bottom: .25rem;
}

.form-control, .form-select {
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    color: var(--ink);
    transition: border-color .12s ease, box-shadow .12s ease;
}

.form-control:focus, .form-select:focus {
    border-color: var(--sea-500);
    box-shadow: 0 0 0 3px rgba(47, 159, 176, .18);
}

.form-control::placeholder { color: #aab4b9; }

/* --------------------------------------------------------------------------
   Buttons
   -------------------------------------------------------------------------- */
.btn { border-radius: var(--radius-sm); font-weight: 600; }

.btn-primary {
    --bs-btn-bg: var(--sea-600);
    --bs-btn-border-color: var(--sea-600);
    --bs-btn-hover-bg: var(--sea-700);
    --bs-btn-hover-border-color: var(--sea-700);
    --bs-btn-active-bg: var(--sea-800);
    --bs-btn-active-border-color: var(--sea-800);
    --bs-btn-disabled-bg: var(--sea-600);
    --bs-btn-disabled-border-color: var(--sea-600);
}

.btn-outline-secondary {
    --bs-btn-color: var(--ink-soft);
    --bs-btn-border-color: var(--line);
    --bs-btn-hover-bg: var(--line-soft);
    --bs-btn-hover-border-color: var(--muted);
    --bs-btn-hover-color: var(--ink);
}

.btn-outline-primary {
    --bs-btn-color: var(--sea-700);
    --bs-btn-border-color: var(--sea-500);
    --bs-btn-hover-bg: var(--sea-600);
    --bs-btn-hover-border-color: var(--sea-600);
}

/* --------------------------------------------------------------------------
   Alerts / top alert
   -------------------------------------------------------------------------- */
#top-alert {
    border: none;
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-md);
    background: var(--ok-bg);
    color: #14613f;
    font-weight: 600;
    padding: .6rem 1.1rem;
}

.alert { border-radius: var(--radius-sm); border: none; }
.alert-danger { background: var(--err-bg); color: #8f2a2a; }

/* --------------------------------------------------------------------------
   Login screen
   -------------------------------------------------------------------------- */
.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
    background:
        radial-gradient(1100px 520px at 50% -8%, rgba(95, 208, 196, .22), transparent 60%),
        linear-gradient(160deg, var(--sea-800) 0%, var(--sea-900) 100%);
}

.login-card {
    width: 100%;
    max-width: 400px;
    background: var(--surface);
    border-radius: 16px;
    box-shadow: 0 18px 50px rgba(8, 47, 56, .35);
    overflow: hidden;
}

.login-head {
    text-align: center;
    padding: 1.9rem 2rem 1.2rem;
}

.login-head img { width: 56px; height: 56px; border-radius: 14px; margin-bottom: .8rem; }

.login-head h1 { font-size: 1.35rem; margin: 0; }

.login-head .login-sub {
    font-size: .82rem;
    color: var(--muted);
    margin-top: .25rem;
}

.login-body { padding: .5rem 2rem 2rem; }

/* --------------------------------------------------------------------------
   Dashboard
   -------------------------------------------------------------------------- */
.dash-hero {
    background: linear-gradient(135deg, var(--sea-700) 0%, var(--sea-900) 100%);
    color: #fff;
    border-radius: var(--radius);
    padding: 1.7rem 1.8rem;
    box-shadow: var(--shadow-md);
    position: relative;
    overflow: hidden;
}

.dash-hero::after {
    content: "";
    position: absolute;
    right: -40px; bottom: -60px;
    width: 240px; height: 240px;
    background: radial-gradient(circle, rgba(95, 208, 196, .25), transparent 70%);
}

.dash-hero h1 { color: #fff; margin: 0; font-size: 1.5rem; }
.dash-hero p { color: var(--sea-300); margin: .35rem 0 0; font-size: .95rem; }

.stat-card {
    display: flex;
    align-items: center;
    gap: 1rem;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    padding: 1.1rem 1.2rem;
    height: 100%;
    transition: box-shadow .15s ease, transform .15s ease;
}
.stat-card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }

.stat-icon {
    width: 48px; height: 48px;
    border-radius: 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.35rem;
    flex: none;
    background: var(--sea-300);
    color: var(--sea-800);
}
.stat-icon.teal { background: #d6f1ec; color: var(--sea-700); }
.stat-icon.blue { background: #d5e8ef; color: #1d6f86; }
.stat-icon.gold { background: #fbeccb; color: var(--accent-dark); }
.stat-icon.green { background: var(--ok-bg); color: var(--ok); }

.stat-value { font-size: 1.7rem; font-weight: 700; line-height: 1; color: var(--ink); }
.stat-label { font-size: .82rem; color: var(--muted); margin-top: .2rem; }

.quick-card {
    display: block;
    height: 100%;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    padding: 1.15rem 1.2rem;
    color: var(--ink);
    transition: box-shadow .15s ease, transform .15s ease, border-color .15s ease;
}
.quick-card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
    border-color: var(--sea-400);
    color: var(--ink);
}

.quick-card .quick-icon {
    width: 40px; height: 40px;
    border-radius: 10px;
    background: var(--sea-300);
    color: var(--sea-800);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.15rem;
    margin-bottom: .65rem;
}

.quick-card .quick-title { font-weight: 650; font-size: 1rem; }
.quick-card .quick-desc { font-size: .82rem; color: var(--muted); margin-top: .15rem; }

.section-label {
    font-size: .72rem;
    font-weight: 700;
    letter-spacing: .07em;
    text-transform: uppercase;
    color: var(--muted);
    margin: 1.6rem 0 .7rem;
}
