/* =====================================================================
   Teslim — design system
   Cohesive look across the business app, admin panel and marketing site.
   Layered on top of Bootstrap 5 via CSS variables + component overrides.
   ===================================================================== */

:root {
    /* Brand palette */
    --tw-brand: #4f46e5;       /* indigo-600 */
    --tw-brand-600: #4338ca;
    --tw-brand-700: #3730a3;
    --tw-brand-50: #eef2ff;
    --tw-accent: #06b6d4;      /* cyan-500 */

    /* Neutrals (slate) */
    --tw-ink: #0f172a;
    --tw-body: #334155;
    --tw-muted: #64748b;
    --tw-line: #e2e8f0;
    --tw-surface: #ffffff;
    --tw-bg: #f6f7fb;

    --tw-radius: 12px;
    --tw-radius-lg: 18px;
    --tw-shadow-sm: 0 1px 2px rgba(15, 23, 42, .06), 0 1px 3px rgba(15, 23, 42, .08);
    --tw-shadow: 0 4px 6px -1px rgba(15, 23, 42, .07), 0 2px 4px -2px rgba(15, 23, 42, .06);
    --tw-shadow-lg: 0 20px 25px -5px rgba(15, 23, 42, .10), 0 8px 10px -6px rgba(15, 23, 42, .08);

    /* Bootstrap variable overrides */
    --bs-primary: var(--tw-brand);
    --bs-primary-rgb: 79, 70, 229;
    --bs-body-color: var(--tw-body);
    --bs-body-bg: var(--tw-bg);
    --bs-border-color: var(--tw-line);
    --bs-link-color: var(--tw-brand-600);
    --bs-link-hover-color: var(--tw-brand-700);
    --bs-font-sans-serif: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

html { position: relative; min-height: 100%; font-size: 16px; }

body {
    margin: 0;
    background: var(--tw-bg);
    color: var(--tw-body);
    font-family: var(--bs-font-sans-serif);
    -webkit-font-smoothing: antialiased;
    letter-spacing: -0.005em;
}

h1, h2, h3, h4, h5, h6, .navbar-brand {
    font-family: "Plus Jakarta Sans", var(--bs-font-sans-serif);
    color: var(--tw-ink);
    font-weight: 700;
    letter-spacing: -0.02em;
}

a { text-decoration: none; }
a:hover { text-decoration: none; }

/* ---------- Layout ---------- */
.page-container { max-width: 1140px; }
main { min-height: 60vh; }

/* ---------- Navbar ---------- */
.navbar {
    background: rgba(255, 255, 255, .85) !important;
    backdrop-filter: saturate(180%) blur(12px);
    border-bottom: 1px solid var(--tw-line) !important;
    box-shadow: none !important;
    padding-top: .6rem;
    padding-bottom: .6rem;
}
.navbar-brand {
    font-size: 1.35rem;
    font-weight: 800;
    color: var(--tw-brand-600) !important;
    display: inline-flex;
    align-items: center;
    gap: .5rem;
}
.navbar-brand img { width: 28px; height: 28px; border-radius: 8px; }
.navbar .nav-link {
    color: var(--tw-body) !important;
    font-weight: 500;
    border-radius: 8px;
    padding: .4rem .75rem !important;
    transition: background .15s, color .15s;
}
.navbar .nav-link:hover { background: var(--tw-brand-50); color: var(--tw-brand-700) !important; }

/* ---------- Buttons ---------- */
.btn {
    --bs-btn-border-radius: 10px;
    border-radius: 10px;
    font-weight: 600;
    padding: .5rem 1rem;
    transition: transform .04s ease, box-shadow .15s ease, background .15s ease;
}
.btn:active { transform: translateY(1px); }
.btn-lg { padding: .7rem 1.4rem; border-radius: 12px; }
.btn-primary {
    --bs-btn-bg: var(--tw-brand);
    --bs-btn-border-color: var(--tw-brand);
    --bs-btn-hover-bg: var(--tw-brand-600);
    --bs-btn-hover-border-color: var(--tw-brand-600);
    --bs-btn-active-bg: var(--tw-brand-700);
    box-shadow: 0 1px 2px rgba(79, 70, 229, .35);
}
.btn-primary:hover { box-shadow: 0 6px 16px -4px rgba(79, 70, 229, .5); }
.btn-outline-secondary { --bs-btn-border-color: var(--tw-line); --bs-btn-color: var(--tw-body); --bs-btn-hover-bg: var(--tw-ink); --bs-btn-hover-border-color: var(--tw-ink); }
.btn-link { color: var(--tw-brand-600); font-weight: 600; }
.btn:focus, .btn:active:focus, .form-control:focus, .form-select:focus, .form-check-input:focus {
    box-shadow: 0 0 0 .2rem rgba(79, 70, 229, .25);
}

/* ---------- Cards ---------- */
.card {
    border: 1px solid var(--tw-line);
    border-radius: var(--tw-radius-lg);
    background: var(--tw-surface);
    box-shadow: var(--tw-shadow-sm);
    transition: box-shadow .18s ease, transform .18s ease;
}
.card:hover { box-shadow: var(--tw-shadow); }
.card-body { padding: 1.25rem; }
.card-title { font-weight: 700; }

/* ---------- Forms ---------- */
.form-label { font-weight: 600; color: var(--tw-ink); font-size: .9rem; margin-bottom: .3rem; }
.form-control, .form-select {
    border-radius: 10px;
    border-color: var(--tw-line);
    padding: .55rem .8rem;
    background-color: #fff;
}
/* keep room for the dropdown caret so it never overlaps the text */
.form-select { padding-right: 2.25rem; background-position: right .75rem center; }
.form-control::placeholder { color: #94a3b8; }

/* ---------- Tables ---------- */
.table { --bs-table-bg: transparent; color: var(--tw-body); }
.table > thead { background: #f8fafc; }
.table > thead th {
    text-transform: uppercase;
    font-size: .72rem;
    letter-spacing: .06em;
    color: var(--tw-muted);
    font-weight: 700;
    border-bottom: 1px solid var(--tw-line);
}
.table > tbody td { border-color: #eef2f7; padding-top: .8rem; padding-bottom: .8rem; vertical-align: middle; }
.table-hover > tbody > tr:hover > * { background: var(--tw-brand-50); }

/* Wrap tables in a card-like surface */
.table-surface {
    background: var(--tw-surface);
    border: 1px solid var(--tw-line);
    border-radius: var(--tw-radius-lg);
    box-shadow: var(--tw-shadow-sm);
    overflow: hidden;
}
.table-surface .table { margin-bottom: 0; }
.table-surface .table > :not(caption) > * > * { padding-left: 1.1rem; padding-right: 1.1rem; }

/* ---------- Badges ---------- */
.badge { font-weight: 600; border-radius: 999px; padding: .35em .7em; letter-spacing: .01em; }
.bg-info { background: #cffafe !important; color: #0e7490 !important; }
.bg-secondary { background: #e2e8f0 !important; color: #475569 !important; }
.bg-success { background: #dcfce7 !important; color: #15803d !important; }
.bg-danger { background: #fee2e2 !important; color: #b91c1c !important; }
.bg-warning { background: #fef9c3 !important; color: #a16207 !important; }

/* ---------- Alerts ---------- */
.alert { border: 1px solid transparent; border-radius: var(--tw-radius); }
.alert-success { background: #ecfdf5; border-color: #a7f3d0; color: #065f46; }
.alert-danger { background: #fef2f2; border-color: #fecaca; color: #991b1b; }

/* ---------- Footer ---------- */
.site-footer {
    border-top: 1px solid var(--tw-line);
    background: var(--tw-surface);
    color: var(--tw-muted);
    padding: 1.5rem 0;
    margin-top: 3rem;
}
.site-footer a { color: var(--tw-muted); }
.site-footer a:hover { color: var(--tw-brand-600); }

/* ---------- Auth card ---------- */
.auth-wrap { min-height: 78vh; display: flex; align-items: center; }
.auth-card {
    background: var(--tw-surface);
    border: 1px solid var(--tw-line);
    border-radius: var(--tw-radius-lg);
    box-shadow: var(--tw-shadow-lg);
    padding: 2rem;
}

/* ---------- Hero / marketing ---------- */
.hero {
    background:
        radial-gradient(1200px 500px at 50% -120px, rgba(79, 70, 229, .12), transparent 60%),
        radial-gradient(900px 400px at 90% 0, rgba(6, 182, 212, .10), transparent 60%);
    border-radius: var(--tw-radius-lg);
}
.hero h1 { font-size: clamp(2rem, 4.5vw, 3.4rem); line-height: 1.05; }
.gradient-text {
    background: linear-gradient(120deg, var(--tw-brand), var(--tw-accent));
    -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
}
.feature-icon {
    width: 46px; height: 46px; border-radius: 12px;
    display: inline-flex; align-items: center; justify-content: center;
    background: var(--tw-brand-50); color: var(--tw-brand-600);
    font-size: 1.4rem; margin-bottom: .75rem;
}
.price-card.featured { border-color: var(--tw-brand); box-shadow: 0 0 0 1px var(--tw-brand), var(--tw-shadow-lg); }

/* ---------- Board (Vue) ---------- */
#board-app .card { border-radius: 12px; }
.board-col-title { font-size: .8rem; text-transform: uppercase; letter-spacing: .05em; color: var(--tw-muted); }

/* ---------- Misc ---------- */
.text-muted { color: var(--tw-muted) !important; }
.shadow-soft { box-shadow: var(--tw-shadow); }
hr { color: var(--tw-line); opacity: 1; }
.section { padding: 3.5rem 0; }

/* ---------- Sticky footer (push footer to bottom on short pages) ---------- */
body { min-height: 100vh; display: flex; flex-direction: column; }
.site-footer { margin-top: auto; }

/* ---------- Two-panel auth (matches Web) ---------- */
.auth-body { background: var(--tw-surface); }
.auth-split { display: flex; min-height: 100vh; }
.auth-aside {
    flex: 1 1 46%;
    background: linear-gradient(160deg, var(--tw-brand), var(--tw-brand-700));
    color: #fff; display: flex; align-items: center; padding: 3rem;
    position: relative; overflow: hidden;
}
.auth-aside::after {
    content: ""; position: absolute; right: -120px; bottom: -120px;
    width: 360px; height: 360px; border-radius: 50%;
    background: radial-gradient(circle, rgba(255,255,255,.12), transparent 70%);
}
.auth-aside-inner { max-width: 420px; margin: 0 auto; position: relative; z-index: 1; }
.auth-brand {
    color: #fff; font-family: "Plus Jakarta Sans", var(--bs-font-sans-serif);
    font-weight: 800; font-size: 1.5rem; display: inline-flex; gap: .55rem; align-items: center; margin-bottom: 2.25rem;
}
.auth-brand img { width: 30px; height: 30px; border-radius: 8px; }
.auth-aside-title { color: #fff; font-size: 2rem; line-height: 1.15; margin-bottom: .75rem; }
.auth-aside-sub { color: rgba(255,255,255,.85); margin-bottom: 1.6rem; }
.auth-aside-list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: .65rem; }
.auth-aside-list li { display: flex; gap: .6rem; align-items: center; color: rgba(255,255,255,.95); }
.auth-aside-list .pf-check { background: rgba(255,255,255,.22); color: #fff; }
.auth-aside-foot { margin-top: 2.5rem; color: rgba(255,255,255,.7); font-size: .85rem; }
.auth-main { flex: 1 1 54%; display: flex; align-items: center; justify-content: center; padding: 2rem; }
.auth-form { width: 100%; max-width: 430px; }
.auth-form h1 { font-size: 1.7rem; }
.pf-check {
    flex: 0 0 auto; width: 20px; height: 20px; border-radius: 999px;
    display: inline-flex; align-items: center; justify-content: center;
    background: #dcfce7; color: #15803d; font-size: .7rem; font-weight: 700;
}
@media (max-width: 860px) { .auth-aside { display: none; } }

/* ---------- App shell (sidebar) — matches Web ---------- */
.app-shell { display: flex; min-height: 100vh; }
.app-sidebar {
    width: 248px; flex: 0 0 248px; background: var(--tw-surface);
    border-right: 1px solid var(--tw-line); position: sticky; top: 0; height: 100vh;
    display: flex; flex-direction: column; padding: 1.1rem .8rem;
}
.app-brand {
    display: flex; align-items: center; gap: .55rem; padding: .25rem .5rem .85rem;
    font-family: "Plus Jakarta Sans", var(--bs-font-sans-serif); font-weight: 800;
    font-size: 1.25rem; color: var(--tw-brand-600);
}
.app-brand img { width: 28px; height: 28px; border-radius: 8px; }
.app-nav { display: flex; flex-direction: column; gap: .12rem; margin-top: .4rem; flex: 1; overflow-y: auto; }
.app-nav a { display: flex; align-items: center; gap: .65rem; padding: .6rem .7rem; border-radius: 10px; color: var(--tw-body); font-weight: 500; }
.app-nav a span { width: 1.2rem; text-align: center; }
.app-nav a:hover { background: var(--tw-brand-50); color: var(--tw-brand-700); }
.app-nav a.active { background: var(--tw-brand); color: #fff; }
.app-sidebar-foot { border-top: 1px solid var(--tw-line); padding-top: .75rem; }
.app-user { display: flex; align-items: center; gap: .5rem; margin-bottom: .5rem; }
.app-user-avatar {
    width: 32px; height: 32px; border-radius: 999px; background: var(--tw-brand-50);
    color: var(--tw-brand-700); display: inline-flex; align-items: center; justify-content: center;
    font-weight: 700; flex: 0 0 auto;
}
.app-user-mail { font-size: .82rem; color: var(--tw-muted); min-width: 0; }
.app-content { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.app-content main { flex: 1; padding: 1.6rem 2rem; width: 100%; }
@media (max-width: 820px) {
    .app-shell { flex-direction: column; }
    .app-sidebar { width: auto; height: auto; position: static; }
    .app-nav { flex-direction: row; flex-wrap: wrap; }
    .app-content main { padding: 1.25rem; }
}

/* ---------- App topbar (matches Web) ---------- */
.app-content main { max-width: none; }
.app-topbar {
    position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 1rem;
    padding: .55rem 1.5rem; background: rgba(255,255,255,.85);
    -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--tw-line);
}
.app-search { position: relative; flex: 1; max-width: 520px; margin: 0 auto; }
.app-search-ico { position: absolute; left: .8rem; top: 50%; transform: translateY(-50%); color: var(--tw-muted); font-size: .85rem; pointer-events: none; }
.app-search input { padding-left: 2.3rem; border-radius: 999px; background: var(--tw-bg); }
.app-topbar-actions { display: flex; align-items: center; gap: .5rem; margin-left: auto; }
.tb-btn {
    position: relative; width: 38px; height: 38px; border-radius: 10px; border: 1px solid var(--tw-line);
    background: var(--tw-surface); color: var(--tw-body); display: inline-flex; align-items: center; justify-content: center; cursor: pointer;
}
.tb-btn:hover { background: var(--tw-brand-50); }
.tb-lang { width: auto; border-radius: 10px; }
.tb-dot { position: absolute; top: 7px; right: 8px; width: 8px; height: 8px; border-radius: 999px; background: #ef4444; border: 2px solid var(--tw-surface); }
.tb-avatar { width: 38px; height: 38px; border-radius: 999px; border: 0; background: linear-gradient(135deg, var(--tw-brand), var(--tw-accent)); color: #fff; font-weight: 700; cursor: pointer; }
.tb-menu { position: relative; }
.tb-dropdown {
    position: absolute; top: calc(100% + 8px); right: 0; min-width: 220px; background: var(--tw-surface);
    border: 1px solid var(--tw-line); border-radius: 12px; box-shadow: var(--tw-shadow-lg); padding: .4rem; display: none; z-index: 30;
}
.tb-menu:hover .tb-dropdown, .tb-menu:focus-within .tb-dropdown { display: block; }
.tb-dropdown a, .tb-dd-logout {
    display: flex; align-items: center; gap: .5rem; width: 100%; text-align: left;
    padding: .55rem .6rem; border-radius: 8px; color: var(--tw-body); background: transparent; border: 0; font-size: .92rem; cursor: pointer;
}
.tb-dropdown a:hover, .tb-dd-logout:hover { background: var(--tw-brand-50); color: var(--tw-brand-700); }
.tb-dd-head { padding: .45rem .6rem; font-size: .8rem; color: var(--tw-muted); border-bottom: 1px solid var(--tw-line); margin-bottom: .25rem; }
.tb-dd-empty { padding: .6rem; color: var(--tw-muted); font-size: .88rem; }
.tb-dd-logout { color: #dc2626; }
.flag { width: 22px; height: 15px; border-radius: 3px; object-fit: cover; box-shadow: 0 0 0 1px var(--tw-line); display: inline-block; vertical-align: middle; }
.tb-dropdown .flag { margin-right: .15rem; }
@media (max-width: 820px) { .app-topbar { padding: .5rem .9rem; } .app-search { max-width: none; } }

/* ---------- Table cell color (readable in both themes) ---------- */
.table {
    --bs-table-bg: transparent;
    --bs-table-color: var(--tw-body);
    --bs-table-color-state: var(--tw-body);
    --bs-table-hover-color: var(--tw-body);
    --bs-emphasis-color: var(--tw-body);
}

/* ---------- Theme toggle visibility ---------- */
.t-light { display: inline; } .t-dark { display: none; }
html.dark .t-light { display: none; } html.dark .t-dark { display: inline; }

/* ---------- Dark theme ---------- */
html.dark {
    --tw-bg: #0b1120; --tw-surface: #0f172a; --tw-ink: #e2e8f0; --tw-body: #cbd5e1;
    --tw-muted: #94a3b8; --tw-line: #1e293b; --tw-brand-50: #1e1b4b;
}
html.dark body { background: var(--tw-bg); color: var(--tw-body); }
html.dark .app-topbar { background: rgba(15, 23, 42, .85); }
html.dark .form-control, html.dark .form-select { background-color: #0b1120; color: var(--tw-body); border-color: var(--tw-line); }
html.dark .form-control::placeholder { color: #64748b; }
html.dark .table > thead { background: #0b1120; }
html.dark .app-search input { background: #0b1120; }
html.dark .card-title, html.dark h1, html.dark h2, html.dark h3, html.dark h4, html.dark h5 { color: var(--tw-ink); }
html.dark .modal-content { background: var(--tw-surface); color: var(--tw-body); border: 1px solid var(--tw-line); }
html.dark .modal-header, html.dark .modal-footer { border-color: var(--tw-line); }
html.dark .btn-close { filter: invert(1) grayscale(1) brightness(1.6); }
html.dark .page-link { background: var(--tw-surface); border-color: var(--tw-line); color: var(--tw-body); }
html.dark .page-link:hover { background: var(--tw-brand-50); color: var(--tw-ink); }
html.dark .page-item.active .page-link { background: var(--tw-brand); border-color: var(--tw-brand); color: #fff; }
html.dark .page-item.disabled .page-link { background: var(--tw-surface); color: var(--tw-muted); }
html.dark .list-group-item { background: var(--tw-surface); color: var(--tw-body); border-color: var(--tw-line); }
html.dark .form-select {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%2394a3b8' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='m2 5 6 6 6-6'/%3e%3c/svg%3e");
}
html.dark .btn-outline-secondary { --bs-btn-color: var(--tw-body); --bs-btn-border-color: var(--tw-line); --bs-btn-hover-bg: #1e293b; --bs-btn-hover-border-color: #334155; --bs-btn-hover-color: var(--tw-ink); }
html.dark .btn-outline-primary { --bs-btn-color: #a5b4fc; --bs-btn-border-color: #3730a3; }
html.dark .alert-success { background: #052e23; border-color: #14532d; color: #86efac; }
html.dark .alert-danger { background: #2a0f12; border-color: #7f1d1d; color: #fca5a5; }
html.dark code { color: #f0abfc; }

/* ---------- Tenant detail metric cards ---------- */
.metric { position: relative; overflow: hidden; }
.metric::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: var(--c, var(--tw-brand)); }
.metric .metric-ico { width: 38px; height: 38px; border-radius: 10px; display: inline-flex; align-items: center; justify-content: center; font-size: 1.1rem; color: #fff; margin-bottom: .5rem; }
.metric .metric-val { font-family: "Plus Jakarta Sans", var(--bs-font-sans-serif); font-weight: 800; font-size: 1.6rem; color: var(--tw-ink); line-height: 1; }
.metric .metric-lbl { color: var(--tw-muted); font-size: .85rem; margin-top: .25rem; }

/* ---------- Vertical config sections ---------- */
.sec-head { display: flex; align-items: center; gap: .7rem; margin-bottom: 1rem; }
.sec-ico { width: 38px; height: 38px; border-radius: 10px; display: inline-flex; align-items: center; justify-content: center; font-size: 1.1rem; color: #fff; flex: 0 0 auto; }
.sec-head h5 { margin: 0; font-family: "Plus Jakarta Sans", var(--bs-font-sans-serif); }
.cfg-add { background: var(--tw-bg); border: 1px solid var(--tw-line); border-radius: var(--tw-radius); padding: .75rem; }
.itype-card { border: 1px solid var(--tw-line); border-radius: var(--tw-radius); padding: 1rem; margin-bottom: .9rem; background: var(--tw-bg); }
.itype-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: .6rem; }
