/* ─────────────────────────────────────────────────────────
   KyrahCreation ERP — Brand Design System
   ───────────────────────────────────────────────────────── */

@import url('https://fonts.googleapis.com/css2?family=Cormorant+Garamond:ital,wght@0,300;0,400;0,500;0,600;1,300;1,400&family=Montserrat:wght@300;400;500;600&display=swap');

/* ── Variables ──────────────────────────────────────────── */
:root {
    --kc-emerald:   #014421;
    --kc-deep:      #022d1a;
    --kc-gold:      #D4AF37;
    --kc-soft-gold: #C9A227;
    --kc-champagne: #F5E6C8;
    --kc-cream:     #FAF7F2;
    --kc-black:     #111111;
    --kc-gray:      #999999;

    --font-heading: 'Cormorant Garamond', Georgia, serif;
    --font-body:    'Montserrat', system-ui, sans-serif;

    --bs-primary:           #014421;
    --bs-primary-rgb:       1, 68, 33;
    --bs-body-font-family:  'Montserrat', system-ui, sans-serif;
    --bs-body-color:        #111111;
    --bs-link-color:        #014421;
    --bs-link-hover-color:  #D4AF37;
}

/* ── Reset / Base ───────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }

body {
    font-family: var(--font-body);
    font-size: 14px;
    line-height: 1.7;
    color: var(--kc-black);
    background-color: var(--kc-cream);
    margin: 0;
}

h1, h2, h3, h4 {
    font-family: var(--font-heading);
    color: var(--kc-emerald);
    font-weight: 400;
    line-height: 1.2;
    margin: 0 0 .5rem;
}

a { color: var(--kc-emerald); text-decoration: none; transition: color .2s; }
a:hover { color: var(--kc-gold); }

.section-label {
    font-size: 11px;
    font-weight: 600;
    letter-spacing: .2em;
    text-transform: uppercase;
    color: var(--kc-gray);
}

/* ── Buttons ────────────────────────────────────────────── */
.btn-brand, .btn-emerald, .btn-ghost {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .4rem;
    font-family: var(--font-body);
    font-size: 12px;
    font-weight: 600;
    letter-spacing: .12em;
    text-transform: uppercase;
    border: none;
    border-radius: 999px;
    padding: 11px 30px;
    cursor: pointer;
    transition: all .3s ease;
    text-decoration: none;
}

.btn-brand {
    background: var(--kc-gold);
    color: var(--kc-emerald);
}
.btn-brand:hover {
    background: var(--kc-soft-gold);
    color: var(--kc-emerald);
    transform: translateY(-1px);
    box-shadow: 0 8px 22px rgba(212,175,55,.35);
}

.btn-emerald {
    background: var(--kc-emerald);
    color: #fff;
}
.btn-emerald:hover {
    background: var(--kc-gold);
    color: var(--kc-emerald);
    transform: translateY(-1px);
    box-shadow: 0 8px 22px rgba(212,175,55,.28);
}

.btn-ghost {
    background: transparent;
    color: var(--kc-gold);
    border: 1px solid var(--kc-gold);
}
.btn-ghost:hover {
    background: rgba(212,175,55,.08);
    color: var(--kc-gold);
    transform: translateY(-1px);
}

/* ── Form Controls ──────────────────────────────────────── */
.form-label {
    font-size: 11px;
    font-weight: 600;
    letter-spacing: .1em;
    text-transform: uppercase;
    color: var(--kc-emerald);
    margin-bottom: .4rem;
}

.form-control, .form-select {
    font-family: var(--font-body);
    font-size: 13.5px;
    border: 1px solid rgba(1,68,33,.18);
    border-radius: 8px;
    padding: .6rem .9rem;
    background: #fff;
    transition: border-color .2s, box-shadow .2s;
    color: var(--kc-black);
}
.form-control:focus, .form-select:focus {
    border-color: var(--kc-gold);
    box-shadow: 0 0 0 3px rgba(212,175,55,.15);
    outline: none;
}
.form-control[readonly], .form-control.auto-calc {
    background: #edf7f1;
    color: var(--kc-emerald);
    border-color: rgba(1,68,33,.12);
    cursor: not-allowed;
}

/* ── Auth Layout ────────────────────────────────────────── */
.kc-auth-wrap {
    min-height: 100vh;
    display: grid;
    grid-template-columns: 1fr 1fr;
}

@media (max-width: 768px) {
    .kc-auth-wrap { grid-template-columns: 1fr; }
    .kc-auth-panel { display: none; }
}

/* Left decorative panel */
.kc-auth-panel {
    background: var(--kc-deep);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 3rem;
    position: relative;
    overflow: hidden;
}
.kc-auth-panel::before {
    content: '';
    position: absolute;
    inset: 0;
    background:
        radial-gradient(ellipse at 30% 40%, rgba(212,175,55,.12) 0%, transparent 60%),
        radial-gradient(ellipse at 70% 70%, rgba(1,68,33,.6) 0%, transparent 55%);
}
.kc-auth-panel-logo {
    width: 100px;
    height: 100px;
    object-fit: contain;
    border-radius: 18px;
    position: relative;
    z-index: 1;
    box-shadow: 0 20px 60px rgba(0,0,0,.4);
    margin-bottom: 2rem;
}
.kc-auth-panel-title {
    font-family: var(--font-heading);
    font-size: 2.6rem;
    font-weight: 300;
    color: var(--kc-champagne);
    text-align: center;
    line-height: 1.2;
    position: relative;
    z-index: 1;
    letter-spacing: .02em;
}
.kc-auth-panel-tagline {
    font-size: 11px;
    font-weight: 400;
    letter-spacing: .22em;
    text-transform: uppercase;
    color: rgba(212,175,55,.7);
    margin-top: .75rem;
    position: relative;
    z-index: 1;
}
.kc-auth-panel-divider {
    width: 48px;
    height: 1px;
    background: var(--kc-gold);
    opacity: .4;
    margin: 1.5rem auto;
    position: relative;
    z-index: 1;
}

/* Right form panel */
.kc-auth-form-wrap {
    background: var(--kc-cream);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 3rem 2rem;
}
.kc-auth-form-inner {
    width: 100%;
    max-width: 400px;
}
.kc-auth-form-inner .auth-logo-sm {
    width: 48px;
    height: 48px;
    object-fit: contain;
    border-radius: 10px;
    display: none;
}
@media (max-width: 768px) {
    .kc-auth-form-inner .auth-logo-sm { display: block; margin-bottom: 1.25rem; }
}
.kc-auth-heading {
    font-family: var(--font-heading);
    font-size: 2.5rem;
    font-weight: 400;
    color: var(--kc-emerald);
    letter-spacing: .01em;
    margin-bottom: .2rem;
}
.kc-auth-sub {
    font-size: 11px;
    font-weight: 500;
    letter-spacing: .18em;
    text-transform: uppercase;
    color: var(--kc-gray);
    margin-bottom: 2.25rem;
}
.kc-auth-divider {
    border: none;
    border-top: 1px solid rgba(212,175,55,.22);
    margin: 1.75rem 0;
}

/* ── Alerts ─────────────────────────────────────────────── */
.alert {
    border: none;
    border-radius: 10px;
    font-size: 13px;
    padding: .7rem 1rem;
    margin-bottom: 1.25rem;
}
.alert-danger  { background: #fef2f2; color: #991b1b; }
.alert-warning { background: #fffbeb; color: #92400e; }
.alert-success { background: #f0fdf4; color: #166534; }
.alert-info    { background: #eff6ff; color: #1e40af; }

.kc-warning-banner {
    background: rgba(212,175,55,.1);
    border-left: 3px solid var(--kc-gold);
    border-radius: 0 8px 8px 0;
    padding: .7rem 1rem;
    font-size: 13px;
    color: #7a5c00;
    font-weight: 500;
    margin-bottom: 1.25rem;
}

/* ── Topbar ─────────────────────────────────────────────── */
.kc-topbar {
    position: fixed;
    top: 0; left: 0; right: 0;
    height: 60px;
    background: var(--kc-emerald);
    border-bottom: 1px solid rgba(212,175,55,.18);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 1.5rem;
    z-index: 1030;
}
.kc-topbar .brand {
    display: flex;
    align-items: center;
    gap: .65rem;
    text-decoration: none;
}
.kc-topbar .brand img {
    height: 36px;
    width: 36px;
    object-fit: contain;
    border-radius: 8px;
}
.kc-topbar .brand-name {
    font-family: var(--font-heading);
    font-size: 1.2rem;
    font-weight: 400;
    color: var(--kc-champagne);
    letter-spacing: .03em;
}
.kc-topbar .topbar-right {
    display: flex;
    align-items: center;
    gap: 1rem;
}
.kc-topbar .user-name {
    font-size: 12px;
    font-weight: 500;
    color: rgba(245,230,200,.75);
    letter-spacing: .04em;
}

/* ── Sidebar ────────────────────────────────────────────── */
.kc-sidebar {
    position: fixed;
    top: 60px; left: 0; bottom: 0;
    width: 230px;
    background: var(--kc-deep);
    border-right: 1px solid rgba(212,175,55,.08);
    overflow-y: auto;
    padding: 1rem 0 2rem;
    z-index: 1020;
}
.kc-sidebar::-webkit-scrollbar { width: 3px; }
.kc-sidebar::-webkit-scrollbar-track { background: transparent; }
.kc-sidebar::-webkit-scrollbar-thumb { background: rgba(212,175,55,.2); border-radius: 2px; }

.kc-sidebar .nav-section {
    font-size: 9.5px;
    font-weight: 600;
    letter-spacing: .22em;
    text-transform: uppercase;
    color: rgba(212,175,55,.45);
    padding: 1.25rem 1.1rem .35rem;
}
.kc-sidebar .nav-link {
    display: flex;
    align-items: center;
    gap: .6rem;
    padding: .52rem 1.1rem;
    font-size: 12.5px;
    font-weight: 400;
    color: rgba(245,230,200,.65);
    border-left: 3px solid transparent;
    transition: all .18s ease;
    text-decoration: none;
    letter-spacing: .01em;
}
.kc-sidebar .nav-link svg { flex-shrink: 0; opacity: .6; }
.kc-sidebar .nav-link:hover,
.kc-sidebar .nav-link.active {
    color: var(--kc-champagne);
    background: rgba(212,175,55,.07);
    border-left-color: var(--kc-gold);
}
.kc-sidebar .nav-link:hover svg,
.kc-sidebar .nav-link.active svg { opacity: 1; color: var(--kc-gold); }

/* ── Main Content ───────────────────────────────────────── */
.kc-main {
    margin-left: 230px;
    margin-top: 60px;
    padding: 2rem 2.25rem;
    min-height: calc(100vh - 60px);
}

.kc-page-header { margin-bottom: 1.75rem; }
.kc-page-header h1 { font-size: 1.9rem; font-weight: 500; }
.kc-page-header .breadcrumb { font-size: 11.5px; color: var(--kc-gray); margin: .2rem 0 0; }

/* ── Cards ──────────────────────────────────────────────── */
.kc-card {
    background: #fff;
    border: 1px solid rgba(212,175,55,.14);
    border-radius: 14px;
    overflow: hidden;
    transition: box-shadow .35s ease, border-color .3s ease;
}
.kc-card:hover {
    box-shadow: 0 12px 36px rgba(1,68,33,.09);
    border-color: rgba(212,175,55,.35);
}
.kc-card .kc-card-header {
    background: var(--kc-emerald);
    color: var(--kc-champagne);
    font-family: var(--font-heading);
    font-size: 1.05rem;
    font-weight: 400;
    border-bottom: 1px solid rgba(212,175,55,.18);
    padding: .85rem 1.25rem;
    letter-spacing: .02em;
}
.kc-card .kc-card-body {
    padding: 1.1rem 1.25rem;
}

/* ── Stat Cards ─────────────────────────────────────────── */
.kc-stat {
    background: #fff;
    border: 1px solid rgba(212,175,55,.12);
    border-radius: 12px;
    padding: 1.4rem 1.5rem;
    position: relative;
    overflow: hidden;
    transition: box-shadow .3s;
}
.kc-stat:hover { box-shadow: 0 8px 28px rgba(1,68,33,.08); }
.kc-stat::after {
    content: '';
    position: absolute;
    top: 0; left: 0;
    width: 3px; height: 100%;
    background: var(--kc-gold);
    border-radius: 2px 0 0 2px;
}
.kc-stat .stat-label {
    font-size: 10px;
    font-weight: 600;
    letter-spacing: .18em;
    text-transform: uppercase;
    color: var(--kc-gray);
    margin-bottom: .4rem;
}
.kc-stat .stat-value {
    font-family: var(--font-heading);
    font-size: 2.1rem;
    font-weight: 500;
    color: var(--kc-emerald);
    line-height: 1;
}
.kc-stat .stat-sub {
    font-size: 11px;
    color: var(--kc-gray);
    margin-top: .3rem;
}

/* ── Tables ─────────────────────────────────────────────── */
.kc-table-wrap {
    background: #fff;
    border: 1px solid rgba(212,175,55,.12);
    border-radius: 12px;
    overflow-x: auto;
    overflow-y: hidden;
}
.kc-table-wrap table { margin: 0; }
.kc-table-wrap td.actions-cell,
.kc-table-wrap th.actions-cell { white-space: nowrap; width: 1%; }

/* Compact icon-only action button */
.btn-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px; height: 32px;
    padding: 0;
    border-radius: 8px;
    border: 1px solid rgba(212,175,55,.35);
    background: transparent;
    color: var(--kc-emerald);
    transition: all .18s ease;
    cursor: pointer;
}
.btn-icon:hover {
    background: rgba(212,175,55,.1);
    border-color: var(--kc-gold);
    color: var(--kc-emerald);
}
.btn-icon.btn-icon-danger { color: #991b1b; border-color: rgba(153,27,27,.35); }
.btn-icon.btn-icon-danger:hover { background: rgba(153,27,27,.08); border-color: #991b1b; color: #991b1b; }
.btn-icon svg { display: block; }

/* ── Record Cards (mobile alternative to tables) ──────── */
.kc-cards-wrap { display: none; }

.kc-record-card {
    background: #fff;
    border: 1px solid rgba(212,175,55,.18);
    border-radius: 14px;
    padding: 1rem 1.1rem;
    margin-bottom: .75rem;
    transition: box-shadow .25s ease, border-color .25s ease;
}
.kc-record-card:hover {
    border-color: rgba(212,175,55,.4);
    box-shadow: 0 4px 16px rgba(1,68,33,.06);
}
.kc-record-card-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: .75rem;
    margin-bottom: .65rem;
    padding-bottom: .65rem;
    border-bottom: 1px solid rgba(212,175,55,.12);
}
.kc-record-card-header .record-name {
    font-family: var(--font-heading);
    font-size: 1.15rem;
    font-weight: 500;
    color: var(--kc-emerald);
    margin: 0;
    line-height: 1.2;
}
.kc-record-card-header .record-meta {
    font-size: 10.5px;
    color: var(--kc-gray);
    margin: .25rem 0 0;
    letter-spacing: .06em;
    text-transform: uppercase;
}
.kc-record-card-body {
    display: flex;
    flex-direction: column;
    gap: .45rem;
    margin-bottom: .65rem;
}
.kc-record-card-body .record-field {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: .75rem;
    font-size: 13px;
}
.kc-record-card-body .record-label {
    flex-shrink: 0;
    font-size: 10px;
    font-weight: 600;
    letter-spacing: .14em;
    text-transform: uppercase;
    color: var(--kc-gray);
}
.kc-record-card-body .record-value {
    color: #111;
    text-align: right;
    word-break: break-word;
}
.kc-record-card-body .record-value.muted { color: var(--kc-gray); }
.kc-record-card-actions {
    display: flex;
    gap: .35rem;
    justify-content: flex-end;
    padding-top: .55rem;
    border-top: 1px solid rgba(212,175,55,.08);
}
.kc-table-wrap thead th {
    background: var(--kc-emerald);
    color: var(--kc-champagne);
    font-size: 10.5px;
    font-weight: 600;
    letter-spacing: .14em;
    text-transform: uppercase;
    border: none;
    padding: .85rem 1rem;
    white-space: nowrap;
}
.kc-table-wrap tbody tr {
    border-bottom: 1px solid rgba(212,175,55,.07);
    transition: background .15s;
}
.kc-table-wrap tbody tr:last-child { border-bottom: none; }
.kc-table-wrap tbody tr:hover { background: rgba(212,175,55,.04); }
.kc-table-wrap tbody td {
    padding: .72rem 1rem;
    font-size: 13px;
    vertical-align: middle;
    border: none;
}

/* ── Badges ─────────────────────────────────────────────── */
.kc-badge {
    display: inline-block;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: .06em;
    text-transform: uppercase;
    padding: .28em .75em;
    border-radius: 999px;
}
.badge-available  { background: #d1fae5; color: #065f46; }
.badge-sold       { background: #fee2e2; color: #991b1b; }
.badge-memo       { background: #fef3c7; color: #92400e; }
.badge-reserved   { background: #dbeafe; color: #1e40af; }
.badge-hold       { background: #f3e8ff; color: #6b21a8; }
.badge-returned   { background: #f1f5f9; color: #475569; }

/* ── 403 / Error Pages ──────────────────────────────────── */
.kc-error-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--kc-cream);
    text-align: center;
    padding: 2rem;
}
.kc-error-code {
    font-family: var(--font-heading);
    font-size: 9rem;
    font-weight: 300;
    color: var(--kc-emerald);
    opacity: .12;
    line-height: 1;
}
.kc-error-body { margin-top: -3rem; }
.kc-error-body h1 { font-size: 2.25rem; }

/* ── Animations ─────────────────────────────────────────── */
@keyframes kcFadeUp {
    from { opacity: 0; transform: translateY(24px); }
    to   { opacity: 1; transform: translateY(0); }
}
.kc-fade-up { animation: kcFadeUp .75s cubic-bezier(.22,1,.36,1) forwards; }
.kc-fade-up-delay { animation: kcFadeUp .75s .15s cubic-bezier(.22,1,.36,1) both; }

/* ── OTP Input (moved from verify-otp.php inline style) ─── */
.otp-input {
    font-family: var(--font-heading);
    font-size: 2.2rem;
    letter-spacing: .7rem;
    text-align: center;
    padding: .6rem 1rem;
}

/* ── Sidebar Toggle Button (topbar) — visible at all breakpoints ── */
.kc-sidebar-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    color: var(--kc-champagne);
    cursor: pointer;
    padding: 6px 8px;
    border-radius: 6px;
    margin-right: .25rem;
    transition: background .2s;
}
.kc-sidebar-toggle:hover { background: rgba(255,255,255,.1); }

/* Smooth slide for sidebar + content */
.kc-sidebar { transition: transform .3s cubic-bezier(.22,1,.36,1); }
.kc-main    { transition: margin-left .3s cubic-bezier(.22,1,.36,1); }

/* Desktop collapsed state */
body.sidebar-collapsed .kc-sidebar { transform: translateX(-100%); }
body.sidebar-collapsed .kc-main    { margin-left: 0; }

/* ── Sidebar Overlay (mobile dim) ───────────────────────── */
.kc-sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.45);
    z-index: 1019;
    backdrop-filter: blur(2px);
}
.kc-sidebar-overlay.active { display: block; }

/* ── Responsive — Tablet & Mobile (< 992px) ─────────────── */
@media (max-width: 991.98px) {
    .kc-sidebar-toggle { display: flex; }

    .kc-sidebar {
        transform: translateX(-100%);
        transition: transform .3s cubic-bezier(.22,1,.36,1);
        z-index: 1020;
    }
    .kc-sidebar.open { transform: translateX(0); }

    .kc-main {
        margin-left: 0;
        padding: 1.25rem 1rem;
    }

    .kc-page-header h1 { font-size: 1.5rem; }

    /* Hide table, show cards instead */
    .kc-table-wrap { display: none; }
    .kc-cards-wrap { display: block; }
}

/* ── Responsive — Mobile only (< 576px) ─────────────────── */
@media (max-width: 575.98px) {
    .kc-topbar { padding: 0 .75rem; }
    .kc-topbar .brand-name { display: none; }

    .kc-main { padding: 1rem .75rem; }

    .kc-stat { padding: 1rem 1.1rem; }
    .kc-stat .stat-value { font-size: 1.6rem; }
}

/* ── Bank-detail value formatting (employees/view.php) ─────────── */
.kc-bank-text { font-size: 14px; }
.kc-bank-mono { font-size: 14px; font-family: monospace; letter-spacing: .04em; }
