/* Tech Zone Solutions & Designs – brand theme on top of Bootstrap 5 */
:root {
    --tz-green: #72ab0f;
    --tz-green-dark: #5d8d0b;
    --tz-green-light: #a6d14a;
    --tz-navy: #0b2a3f;
    --tz-navy-light: #14405e;
    --tz-bg: #f4f6f8;
    --sidebar-width: 250px;
    --bs-link-color: var(--tz-navy-light);
    --bs-link-color-rgb: 20, 64, 94;
    --bs-link-hover-color: var(--tz-green-dark);
}

html { font-size: 15px; }
body { background: var(--tz-bg); }

.btn-brand { background: var(--tz-green); border-color: var(--tz-green); color: #fff; }
.btn-brand:hover, .btn-brand:focus { background: var(--tz-green-dark); border-color: var(--tz-green-dark); color: #fff; }
.btn-brand-navy { background: var(--tz-navy); border-color: var(--tz-navy); color: #fff; }
.btn-brand-navy:hover, .btn-brand-navy:focus { background: var(--tz-navy-light); border-color: var(--tz-navy-light); color: #fff; }
.text-brand-navy { color: var(--tz-navy); }
.badge-role { background: rgba(114, 171, 15, .15); color: var(--tz-green-dark); font-weight: 600; }

.form-control:focus, .form-select:focus, .form-check-input:focus {
    border-color: var(--tz-green-light);
    box-shadow: 0 0 0 .2rem rgba(114, 171, 15, .2);
}
.form-check-input:checked { background-color: var(--tz-green); border-color: var(--tz-green); }

/* ---------- App shell ---------- */
/* The sidebar is a full-height column at every width (fixed panel on desktop, off-canvas on small screens):
   the logo stays put and the link list scrolls on its own. */
.app-sidebar {
    background: var(--tz-navy);
    color: #cfd9e1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}
@media (min-width: 992px) {
    .app-sidebar { position: fixed; inset: 0 auto 0 0; width: var(--sidebar-width); background: var(--tz-navy) !important; }
    .app-main { margin-left: var(--sidebar-width); }
}
.app-sidebar-brand { flex-shrink: 0; }
.app-sidebar .app-nav {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    overscroll-behavior: contain;
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, .25) transparent;
}
.app-sidebar .app-nav::-webkit-scrollbar { width: 6px; }
.app-sidebar .app-nav::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, .25); border-radius: 3px; }
.app-sidebar.offcanvas-lg { --bs-offcanvas-width: var(--sidebar-width); --bs-offcanvas-bg: var(--tz-navy); }

.app-sidebar-brand {
    display: flex; align-items: center; justify-content: space-between;
    background: #fff; padding: .75rem 1rem; border-bottom: 4px solid var(--tz-green);
}
.app-sidebar-brand img { max-width: 170px; height: auto; }

.app-nav { display: flex; flex-direction: column; padding: .75rem 0; width: 100%; }
.app-nav-section {
    font-size: .7rem; text-transform: uppercase; letter-spacing: .08em;
    color: #7f97a8; padding: 1rem 1.25rem .35rem;
}
.app-nav-link {
    display: flex; align-items: center; gap: .75rem;
    color: #cfd9e1; text-decoration: none; padding: .55rem 1.25rem;
    border-left: 3px solid transparent;
}
.app-nav-link i { font-size: 1.05rem; width: 1.25rem; text-align: center; }
.app-nav-link:hover { color: #fff; background: rgba(255, 255, 255, .05); }
.app-nav-link.active { color: #fff; background: rgba(114, 171, 15, .18); border-left-color: var(--tz-green); }

.app-main { min-height: 100vh; display: flex; flex-direction: column; }
.app-topbar {
    display: flex; align-items: center; gap: .5rem;
    background: #fff; padding: .6rem 1.5rem; border-bottom: 1px solid #e3e7eb;
    position: sticky; top: 0; z-index: 1020;
}
.app-page-title { font-size: 1.15rem; font-weight: 600; margin: 0; color: var(--tz-navy); }
.app-avatar {
    width: 30px; height: 30px; border-radius: 50%;
    background: var(--tz-green); color: #fff; font-weight: 700;
    display: inline-flex; align-items: center; justify-content: center; font-size: .85rem;
}
.app-content { padding: 1.5rem; flex: 1; }
.app-footer { padding: 1rem 1.5rem; font-size: .8rem; color: #8a96a0; border-top: 1px solid #e3e7eb; background: #fff; }
@media (max-width: 575.98px) {
    .app-content { padding: 1rem; }
    .app-topbar { padding: .6rem 1rem; }
}

.table > thead th { font-size: .78rem; text-transform: uppercase; letter-spacing: .03em; color: #6c7a86; font-weight: 600; background: #fafbfc; }

.sticky-actions {
    position: sticky; bottom: 0; margin-top: 1rem; padding: .75rem 1rem;
    background: #fff; border-top: 3px solid var(--tz-green); box-shadow: 0 -2px 8px rgba(0, 0, 0, .05); border-radius: .375rem;
}

/* ---------- Dashboard ---------- */
.stat-card {
    background: #fff; border-radius: .5rem; padding: 1rem; height: 100%;
    box-shadow: 0 1px 3px rgba(0, 0, 0, .06); border-top: 3px solid var(--tz-navy);
}
.stat-card i { font-size: 1.3rem; color: var(--tz-navy); }
.stat-value { font-size: 1.75rem; font-weight: 700; color: var(--tz-navy); line-height: 1.2; margin-top: .25rem; }
.stat-label { font-size: .8rem; color: #6c7a86; }
.stat-green { border-top-color: var(--tz-green); }
.stat-green i { color: var(--tz-green); }
.stat-muted { border-top-color: #adb5bd; }
.stat-danger { border-top-color: #dc3545; }
.stat-danger i, .stat-danger .stat-value { color: #dc3545; }

/* ---------- Sign-in / error pages ---------- */
body.auth { min-height: 100vh; display: flex; flex-direction: column; background: #fff; }
.auth-stripe { height: 14px; background: var(--tz-green-light); }
.auth-card { width: 100%; max-width: 400px; margin: auto; padding: 2.5rem 1.25rem; }
.auth-logo { display: block; max-width: 260px; width: 100%; margin: 0 auto 2rem; }
.auth-divider { display: flex; align-items: center; gap: .75rem; color: #8a96a0; font-size: .8rem; margin: 1rem 0; }
.auth-divider::before, .auth-divider::after { content: ""; flex: 1; border-top: 1px solid #e3e7eb; }

/* ---------- People ---------- */
.min-w-0 { min-width: 0; }
.avatar { border-radius: 50%; object-fit: cover; flex-shrink: 0; display: inline-flex; align-items: center; justify-content: center; }
.avatar-sm { width: 32px; height: 32px; font-size: .75rem; }
.avatar-md { width: 56px; height: 56px; font-size: 1.1rem; }
.avatar-lg { width: 88px; height: 88px; font-size: 1.8rem; border: 3px solid var(--tz-green); }
.avatar-initials { background: var(--tz-navy); color: #fff; font-weight: 700; }
.person-card { transition: transform .12s ease, box-shadow .12s ease; }
.person-card:hover { transform: translateY(-2px); box-shadow: 0 .5rem 1rem rgba(0, 0, 0, .08) !important; }
.profile-header { border-top: 4px solid var(--tz-green) !important; }

.skill-badge { font-weight: 500; margin: 0 .2rem .25rem 0; }
.skill-expert { background: var(--tz-navy); color: #fff; }
.skill-advanced { background: var(--tz-green); color: #fff; }
.skill-intermediate { background: rgba(114, 171, 15, .18); color: var(--tz-green-dark); }
.skill-beginner { background: #eef1f4; color: #55636f; }

.skill-picker { width: 320px; max-height: 360px; overflow-y: auto; }
.skill-option { display: block; margin: 0 0 .15rem; }

.nav-tabs .nav-link { color: #55636f; }
.nav-tabs .nav-link.active { color: var(--tz-navy); font-weight: 600; border-top: 3px solid var(--tz-green); }

/* ---------- CRM ---------- */
.auth-card-wide { max-width: 720px; }
.internal-card { border-left: 4px solid #f0ad4e !important; }
.package-card { border-top: 3px solid var(--tz-green) !important; }

.lead-badge { font-weight: 600; }
.lead-new { background: #e7f1ff; color: #0b5ed7; }
.lead-contacted { background: #e0f7fa; color: #00798a; }
.lead-qualified { background: #efe7ff; color: #6a3fc4; }
.lead-proposalsent { background: #fff4e0; color: #a66300; }
.lead-negotiation { background: #fde8f0; color: #b0306a; }
.lead-won { background: rgba(114, 171, 15, .18); color: var(--tz-green-dark); }
.lead-lost { background: #eceff1; color: #6c7a86; }

.pipeline-bar { background: var(--tz-navy); }
.pipeline-won { background: var(--tz-green); }
.pipeline-lost { background: #adb5bd; }

.lead-board { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(230px, 1fr); gap: .75rem; overflow-x: auto; padding-bottom: .5rem; }
.lead-column { background: #eef1f4; border-radius: .5rem; display: flex; flex-direction: column; min-height: 60vh; }
.lead-column.drop-target { outline: 2px dashed var(--tz-green); }
.lead-column-header { display: flex; justify-content: space-between; align-items: center; padding: .5rem .75rem; border-radius: .5rem .5rem 0 0; font-weight: 600; font-size: .85rem; }
.lead-column-body { padding: .5rem; display: flex; flex-direction: column; gap: .5rem; flex: 1; }
.lead-card { background: #fff; border-radius: .4rem; padding: .6rem .7rem; box-shadow: 0 1px 2px rgba(0, 0, 0, .08); cursor: grab; }
.lead-card.dragging { opacity: .5; }

/* ---------- Orders & quotations ---------- */
.order-note { border-left: 4px solid transparent; }
.note-internal { border-left-color: #adb5bd; background: #fafbfc; }
.note-public { border-left-color: var(--tz-green); }
.note-client { border-left-color: #0b5ed7; background: #f3f8ff; }
.note-management { border-left-color: #f0ad4e; background: #fffaf2; }
.note-dot { display: inline-block; width: .6rem; height: .6rem; border-radius: 50%; }
.note-dot.note-internal { background: #adb5bd; }
.note-dot.note-public { background: var(--tz-green); }
.note-dot.note-management { background: #f0ad4e; }
.order-timeline li { position: relative; padding: 0 0 .75rem 1rem; border-left: 2px solid #e3e7eb; }
.order-timeline li:last-child { padding-bottom: 0; }
.order-timeline li::before { content: ""; position: absolute; left: -6px; top: .35rem; width: 10px; height: 10px; border-radius: 50%; background: var(--tz-green); }
.accept-card { border-top: 3px solid var(--tz-green) !important; }

/* ---------- Projects ---------- */
.bg-brand { background-color: var(--tz-green) !important; }
.task-pending, .task-assigned { background: #eceff1; color: #55636f; }
.task-inprogress { background: #e7f1ff; color: #0b5ed7; }
.task-blocked { background: #fde2e2; color: #b02a37; }
.task-codereview, .task-testing, .task-clientreview { background: #fff4e0; color: #a66300; }
.task-completed { background: rgba(114, 171, 15, .18); color: var(--tz-green-dark); }

.gantt { overflow-x: auto; }
.gantt-row { display: flex; align-items: center; min-height: 1.9rem; border-bottom: 1px dashed #eef1f4; min-width: 720px; }
.gantt-label { flex: 0 0 260px; font-size: .8rem; padding-right: .5rem; }
.gantt-track { position: relative; flex: 1; height: 1.9rem; }
.gantt-scale .gantt-track { height: 1.4rem; border-bottom: 1px solid #dde3e8; }
.gantt-month { position: absolute; top: 0; font-size: .7rem; color: #6c7a86; border-left: 1px solid #dde3e8; padding-left: 3px; }
.gantt-today { position: absolute; top: 0; bottom: -2000px; border-left: 2px solid #dc3545; z-index: 1; }
.gantt-bar { position: absolute; top: .55rem; height: .8rem; border-radius: .3rem; background: var(--tz-navy-light); }
.gantt-phase .gantt-bar { background: var(--tz-navy); top: .45rem; height: 1rem; }
.gantt-bar.done { background: var(--tz-green); }
.gantt-bar.late { background: #dc3545; }
.gantt-diamond { position: absolute; top: .5rem; width: .8rem; height: .8rem; background: #f0ad4e; transform: rotate(45deg); margin-left: -.4rem; }
.gantt-diamond.done { background: var(--tz-green); }

.load-bar { height: .55rem; background: #eef1f4; border-radius: .3rem; overflow: hidden; }
.load-fill { height: 100%; }
.load-low { background: #9ec5fe; }
.load-ok { background: var(--tz-green); }
.load-high { background: #f0ad4e; }
.load-over { background: #dc3545; }

/* ---- Proposals ---- */
.proposal-title { background: var(--tz-navy); color: #fff; border-radius: .5rem; padding: 1.1rem 1.25rem; }
.proposal-kicker { color: #b9d98a; letter-spacing: .06em; font-size: .72rem; }
.proposal-h { font-size: 1.05rem; font-weight: 700; color: var(--tz-navy); border-bottom: 2px solid #eef5e3; padding-bottom: .25rem; margin: 1.25rem 0 .6rem; }
.text-brand { color: var(--tz-green); }

/* ---- Finance ---- */
.finance-bar { height: .45rem; border-radius: .25rem; margin: .15rem 0; min-width: 2px; }
.legend-dot { display: inline-block; width: .6rem; height: .6rem; border-radius: 50%; vertical-align: middle; margin-right: .25rem; }

/* ---- Attendance & leave ---- */
.att-sheet th, .att-sheet td { padding: .2rem .25rem; text-align: center; font-size: .75rem; white-space: nowrap; }
.att-sheet td.att-name, .att-sheet th.att-name { text-align: left; position: sticky; left: 0; background: #fff; z-index: 1; min-width: 11rem; }
.att-cell { display: inline-block; width: 1.4rem; height: 1.4rem; line-height: 1.4rem; border-radius: .25rem; font-weight: 600; }
.att-present { background: #e3f1cd; color: #3d6b05; }
.att-late { background: #fff0c2; color: #8a6100; }
.att-remote { background: #dbeafe; color: #1e4f8f; }
.att-leave { background: #ede4fb; color: #5b2ea6; }
.att-holiday { background: #ffe0e6; color: #a1203f; }
.att-absent { background: #fbd5d5; color: #a61b1b; }
.att-off { background: #f1f3f5; color: #adb5bd; }
.checkin-card .clock { font-size: 1.6rem; font-weight: 700; color: var(--tz-navy); }

/* ---- Media ---- */
.media-thumb { position: relative; height: 9rem; background: #f1f3f5; overflow: hidden; border-radius: .375rem .375rem 0 0; }
.media-thumb img, .media-thumb video { width: 100%; height: 100%; object-fit: cover; }
.media-play { position: absolute; font-size: 2rem; color: rgba(255, 255, 255, .9); text-shadow: 0 0 6px rgba(0, 0, 0, .5); }
.brand-swatch { display: inline-block; width: 1rem; height: 1rem; border-radius: .2rem; border: 1px solid #dee2e6; vertical-align: middle; margin-right: .25rem; }
.badge-brand { background: var(--tz-green); color: #fff; }
.pick-card { cursor: pointer; }
.pick-card input { position: absolute; top: .4rem; left: .4rem; z-index: 2; transform: scale(1.2); }
.pick-card:has(input:checked) .card { outline: 3px solid var(--tz-green); }
.post-text { white-space: pre-wrap; }
.post-media { display: grid; grid-template-columns: repeat(auto-fill, minmax(8rem, 1fr)); gap: .5rem; }
.post-media img, .post-media video { width: 100%; height: 8rem; object-fit: cover; border-radius: .375rem; background: #f1f3f5; }
.trail { border-left: 2px solid #e9ecef; padding-left: 1rem; }
.trail-item { position: relative; margin-bottom: .9rem; }
.trail-item::before { content: ""; position: absolute; left: -1.33rem; top: .35rem; width: .6rem; height: .6rem; border-radius: 50%; background: #adb5bd; }
.trail-item.client::before { background: var(--tz-green); }
.trail-item.internal { opacity: .85; }
.cal-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); border-top: 1px solid #dee2e6; border-left: 1px solid #dee2e6; }
.cal-head { font-size: .75rem; font-weight: 600; text-align: center; padding: .3rem; background: #f8f9fa; border-right: 1px solid #dee2e6; border-bottom: 1px solid #dee2e6; }
.cal-day { min-height: 7rem; padding: .25rem; border-right: 1px solid #dee2e6; border-bottom: 1px solid #dee2e6; background: #fff; min-width: 0; }
.cal-day.other { background: #f8f9fa; color: #adb5bd; }
.cal-day.today { background: #f4f9ea; }
.cal-date { font-size: .75rem; font-weight: 600; }
.cal-entry { display: block; font-size: .72rem; line-height: 1.25; padding: .15rem .3rem; margin-top: .2rem; border-radius: .25rem; border-left: 3px solid var(--tz-navy); background: #f1f3f5; color: inherit; text-decoration: none; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cal-entry:hover { background: #e9ecef; }
.cal-entry.published { opacity: .75; }
.cal-entry.failed { background: #fbd5d5; }
.cal-week .cal-day { min-height: 16rem; }
.cal-week .cal-entry { white-space: normal; }
@media (max-width: 767.98px) {
    .cal-grid.cal-month { grid-template-columns: 1fr; }
    .cal-month .cal-head, .cal-month .cal-day.other { display: none; }
    .cal-month .cal-day { min-height: 0; }
    .cal-month .cal-day:not(:has(.cal-entry)) { display: none; }
    .cal-week { grid-template-columns: 1fr; }
    .cal-week .cal-head { display: none; }
    .cal-week .cal-day { min-height: 0; }
}
.sparkline { width: 100%; height: 3rem; display: block; }
/* ---- Knowledge base ---- */
.kb-body { line-height: 1.65; overflow-wrap: anywhere; }
.kb-body h1, .kb-body h2, .kb-body h3 { color: var(--tz-navy); margin-top: 1.4rem; }
.kb-body h1 { font-size: 1.5rem; } .kb-body h2 { font-size: 1.25rem; } .kb-body h3 { font-size: 1.05rem; }
.kb-body img { max-width: 100%; height: auto; border-radius: .375rem; }
.kb-body table { width: 100%; margin: 1rem 0; border-collapse: collapse; font-size: .9rem; }
.kb-body th, .kb-body td { border: 1px solid #dee2e6; padding: .35rem .5rem; }
.kb-body th { background: #f8f9fa; }
.kb-body pre { background: #0b2a3f; color: #e9ecef; padding: .75rem 1rem; border-radius: .375rem; overflow-x: auto; }
.kb-body code { background: #f1f3f5; padding: .1rem .3rem; border-radius: .25rem; }
.kb-body pre code { background: none; padding: 0; color: inherit; }
.kb-body blockquote { border-left: 3px solid var(--tz-green); padding-left: .75rem; color: #495057; }
.kb-editor { font-family: SFMono-Regular, Consolas, monospace; font-size: .85rem; }
.app-search { width: 18rem; }
