/* =============================================================
   HEKTAŞ TOHUM - Islah Programı Portalı
   Kurumsal Tasarım Sistemi  v1.0
   OYAK Kimya Tarım | Vylence Software
   ============================================================= */

:root {
    /* === Marka renkleri (PDF Bölüm 8.2) === */
    --hk-primary:        #1B3A6B;
    --hk-primary-dark:   #0F2647;
    --hk-primary-darker: #081530;
    --hk-primary-light:  #2A5293;
    --hk-secondary:      #2E9D3F;
    --hk-secondary-dark: #1F7A2C;
    --hk-secondary-light:#C5E8CB;
    --hk-info-light:     #D5E0F0;
    --hk-accent:         #F39C12;
    --hk-accent-light:   #FDEBC6;
    --hk-danger:         #DC3545;
    --hk-warning:        #F39C12;
    --hk-info:           #3498DB;

    /* === Yüzeyler === */
    --hk-bg:             #F5F7FA;
    --hk-surface:        #FFFFFF;
    --hk-surface-2:      #FAFBFD;
    --hk-border:         #E4E8EE;
    --hk-border-strong:  #C7CFDB;

    /* === Metinler === */
    --hk-text:           #1B2438;
    --hk-text-muted:     #5C6678;
    --hk-text-soft:      #8A93A6;
    --hk-text-on-primary:#FFFFFF;

    /* === Logo renkleri === */
    --hk-logo-blue:      #1B3A6B;
    --hk-logo-green:     #2E9D3F;
    --hk-oyak-red:       #E53935;

    /* === Layout ölçüleri === */
    --hk-sidebar-width:        260px;
    --hk-sidebar-width-mini:   72px;
    --hk-header-height:        64px;
    --hk-content-padding:      24px;

    /* === Tipografi === */
    --hk-font-base: 'Inter', 'Segoe UI', 'Helvetica Neue', Arial, sans-serif;
    --hk-font-mono: 'JetBrains Mono', 'Cascadia Code', 'Consolas', monospace;

    --hk-fs-xs: 11px;
    --hk-fs-sm: 12px;
    --hk-fs-base: 14px;
    --hk-fs-lg: 16px;
    --hk-fs-xl: 18px;
    --hk-fs-2xl: 22px;
    --hk-fs-3xl: 28px;
    --hk-fs-4xl: 34px;

    /* === Köşe yuvarlaklığı === */
    --hk-radius-xs: 4px;
    --hk-radius-sm: 6px;
    --hk-radius:    10px;
    --hk-radius-lg: 14px;
    --hk-radius-xl: 20px;

    /* === Gölgeler === */
    --hk-shadow-xs: 0 1px 2px rgba(15,38,71,.06);
    --hk-shadow-sm: 0 2px 6px rgba(15,38,71,.07);
    --hk-shadow:    0 4px 16px rgba(15,38,71,.08);
    --hk-shadow-lg: 0 12px 32px rgba(15,38,71,.10);
    --hk-shadow-focus: 0 0 0 3px rgba(27,58,107,.15);

    /* === Geçişler === */
    --hk-transition: 0.18s cubic-bezier(.4,0,.2,1);
}

/* === Bootstrap renk değişkenleri override (varsa) === */
:root, [data-bs-theme=light] {
    --bs-primary:   #1B3A6B;
    --bs-secondary: #5C6678;
    --bs-success:   #2E9D3F;
    --bs-info:      #3498DB;
    --bs-warning:   #F39C12;
    --bs-danger:    #DC3545;
    --bs-primary-rgb:   27, 58, 107;
    --bs-secondary-rgb: 92, 102, 120;
    --bs-success-rgb:   46, 157, 63;
    --bs-info-rgb:      52, 152, 219;
    --bs-warning-rgb:   243, 156, 18;
    --bs-danger-rgb:    220, 53, 69;
    --bs-body-bg: #F5F7FA;
    --bs-body-color: #1B2438;
    --bs-link-color: #1B3A6B;
    --bs-link-hover-color: #0F2647;
    --bs-border-radius: 10px;
    --bs-border-color: #E4E8EE;
}

/* ============== Global ============== */
* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
    font-family: var(--hk-font-base);
    font-size: var(--hk-fs-base);
    color: var(--hk-text);
    background: var(--hk-bg);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    line-height: 1.55;
    min-height: 100vh;
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--hk-font-base);
    font-weight: 700;
    color: var(--hk-text);
    line-height: 1.2;
    margin: 0 0 .5em;
    letter-spacing: -.01em;
}
h1 { font-size: var(--hk-fs-3xl); font-weight: 800; }
h2 { font-size: var(--hk-fs-2xl); }
h3 { font-size: var(--hk-fs-xl); }
h4 { font-size: var(--hk-fs-lg); }
h5 { font-size: var(--hk-fs-base); }

a {
    color: var(--hk-primary);
    text-decoration: none;
    transition: color var(--hk-transition);
}
a:hover { color: var(--hk-primary-dark); }

code, .mono, .num {
    font-family: var(--hk-font-mono);
    font-feature-settings: "tnum";
}

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: var(--hk-bg); }
::-webkit-scrollbar-thumb { background: var(--hk-border-strong); border-radius: 6px; border: 2px solid var(--hk-bg); }
::-webkit-scrollbar-thumb:hover { background: var(--hk-text-soft); }

/* ============== Login Layout ============== */
.login-page {
    min-height: 100vh;
    background:
        radial-gradient(at 80% 0%, rgba(46,157,63,.12) 0, transparent 50%),
        radial-gradient(at 0% 100%, rgba(27,58,107,.15) 0, transparent 50%),
        linear-gradient(135deg, #0F2647 0%, #1B3A6B 60%, #2E9D3F 200%);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    position: relative;
    overflow: hidden;
}

.login-page::before {
    content: '';
    position: absolute; inset: 0;
    background-image:
        radial-gradient(circle at 25% 30%, rgba(255,255,255,.06) 0, transparent 14%),
        radial-gradient(circle at 75% 70%, rgba(255,255,255,.08) 0, transparent 18%),
        radial-gradient(circle at 50% 50%, rgba(46,157,63,.15) 0, transparent 30%);
    pointer-events: none;
}

.login-wrap {
    display: grid;
    grid-template-columns: 1fr 1fr;
    max-width: 1180px;
    width: 100%;
    background: var(--hk-surface);
    border-radius: var(--hk-radius-xl);
    overflow: hidden;
    box-shadow: 0 30px 80px rgba(0,0,0,.35);
    position: relative;
    z-index: 1;
    min-height: 640px;
}

.login-hero {
    background:
        radial-gradient(at 80% 0%, rgba(46,157,63,.2) 0, transparent 50%),
        linear-gradient(160deg, #0F2647 0%, #1B3A6B 60%, #245293 110%);
    color: #fff;
    padding: 56px 56px 40px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    position: relative;
    overflow: hidden;
}

.login-hero::before, .login-hero::after {
    content: ''; position: absolute; border-radius: 50%;
    background: radial-gradient(circle, rgba(46,157,63,.35) 0, transparent 70%);
}
.login-hero::before { width: 480px; height: 480px; top: -180px; right: -200px; }
.login-hero::after  { width: 320px; height: 320px; bottom: -120px; left: -120px; background: radial-gradient(circle, rgba(27,58,107,.6) 0, transparent 70%); }

.login-hero-content { position: relative; z-index: 2; }
.login-hero h1 {
    font-size: 36px; line-height: 1.15; color: #fff;
    margin-bottom: 16px; font-weight: 800;
}
.login-hero p {
    font-size: 15px; opacity: .85; color: #C5E8CB;
    line-height: 1.6; max-width: 380px; margin: 0;
}
.login-hero .features {
    list-style: none; padding: 0; margin: 32px 0 0;
    display: grid; gap: 12px;
}
.login-hero .features li {
    display: flex; align-items: flex-start; gap: 12px;
    font-size: 13px; opacity: .92;
}
.login-hero .features li i {
    color: var(--hk-secondary-light);
    background: rgba(46,157,63,.18);
    width: 28px; height: 28px;
    border-radius: 8px;
    display: inline-flex; align-items: center; justify-content: center;
    flex-shrink: 0; margin-top: 1px;
}

.login-hero-footer {
    position: relative; z-index: 2;
    display: flex; align-items: center; justify-content: space-between;
    padding-top: 32px;
    border-top: 1px solid rgba(255,255,255,.1);
    font-size: 11px; opacity: .6;
}

.login-form {
    padding: 56px;
    display: flex; flex-direction: column;
    justify-content: center;
}

.brand-mark {
    display: flex; align-items: center; gap: 12px;
    margin-bottom: 36px;
}
.brand-mark-logo {
    width: 50px; height: 50px;
    border-radius: var(--hk-radius);
    display: block;
    object-fit: contain;
    box-shadow: var(--hk-shadow-sm);
}
.brand-mark-text { line-height: 1.15; }
.brand-mark-text strong {
    color: var(--hk-primary);
    font-size: 18px; font-weight: 800; display: block;
}
.brand-mark-text span {
    color: var(--hk-text-muted);
    font-size: 11px; letter-spacing: .04em;
    text-transform: uppercase;
}

.login-form h2 {
    font-size: 28px; margin-bottom: 8px; color: var(--hk-text);
}
.login-form .subtitle {
    color: var(--hk-text-muted); margin-bottom: 32px; font-size: 14px;
}

.form-floating > label {
    color: var(--hk-text-muted);
    font-size: 13px;
}
.form-control, .form-select {
    border-radius: var(--hk-radius-sm);
    border: 1.5px solid var(--hk-border);
    padding: 0.75rem 0.95rem;
    font-size: 14px;
    color: var(--hk-text);
    transition: all var(--hk-transition);
    background: var(--hk-surface);
}
.form-control:focus, .form-select:focus {
    border-color: var(--hk-primary);
    box-shadow: var(--hk-shadow-focus);
}
.form-control::placeholder { color: var(--hk-text-soft); }

.login-form .form-floating { margin-bottom: 16px; }

.btn { font-weight: 600; transition: all var(--hk-transition); }
.btn-primary {
    background: linear-gradient(135deg, var(--hk-primary) 0%, var(--hk-primary-light) 100%);
    border: 0;
    color: #fff;
    padding: 0.7rem 1.4rem;
    border-radius: var(--hk-radius-sm);
    box-shadow: 0 4px 14px rgba(27,58,107,.18);
}
.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 8px 24px rgba(27,58,107,.28);
    background: linear-gradient(135deg, var(--hk-primary-dark) 0%, var(--hk-primary) 100%);
}
.btn-success {
    background: linear-gradient(135deg, var(--hk-secondary) 0%, #3FBA53 100%);
    border: 0; color: #fff;
}
.btn-success:hover { background: var(--hk-secondary-dark); }
.btn-outline-primary {
    border: 1.5px solid var(--hk-primary);
    color: var(--hk-primary);
    background: #fff;
}
.btn-outline-primary:hover {
    background: var(--hk-primary); color: #fff;
}
.btn-light {
    background: var(--hk-surface);
    border: 1.5px solid var(--hk-border);
    color: var(--hk-text);
}
.btn-light:hover {
    background: var(--hk-surface-2);
    border-color: var(--hk-border-strong);
}

.login-button {
    width: 100%; padding: 14px; font-size: 15px; font-weight: 700;
    letter-spacing: .02em;
    border-radius: var(--hk-radius-sm);
}

.login-divider {
    display: flex; align-items: center; gap: 12px;
    margin: 24px 0; color: var(--hk-text-soft); font-size: 12px;
}
.login-divider::before, .login-divider::after {
    content: ''; flex: 1; height: 1px; background: var(--hk-border);
}

.demo-roles {
    display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px;
}
.demo-role-btn {
    border: 1.5px solid var(--hk-border);
    background: var(--hk-surface);
    padding: 10px 12px;
    border-radius: var(--hk-radius-sm);
    font-size: 12px;
    color: var(--hk-text-muted);
    text-align: left;
    transition: all var(--hk-transition);
    display: flex; align-items: center; gap: 8px;
    cursor: pointer;
}
.demo-role-btn:hover {
    border-color: var(--hk-primary);
    color: var(--hk-primary);
    background: var(--hk-info-light);
}
.demo-role-btn i {
    width: 28px; height: 28px;
    background: var(--hk-primary);
    color: white;
    border-radius: 50%;
    display: inline-flex; align-items: center; justify-content: center;
    font-style: normal; font-size: 11px; font-weight: 700;
}

/* ============== App Layout ============== */
.app-layout {
    min-height: 100vh;
    display: grid;
    grid-template-columns: var(--hk-sidebar-width) 1fr;
    grid-template-rows: var(--hk-header-height) 1fr;
    grid-template-areas:
        "sidebar header"
        "sidebar main";
    transition: grid-template-columns var(--hk-transition);
}

.app-layout.sidebar-collapsed {
    grid-template-columns: var(--hk-sidebar-width-mini) 1fr;
}

/* ----- Sidebar ----- */
.app-sidebar {
    grid-area: sidebar;
    background: linear-gradient(180deg, var(--hk-primary-darker) 0%, var(--hk-primary-dark) 100%);
    color: #fff;
    display: flex; flex-direction: column;
    position: fixed; inset: 0 auto 0 0;
    width: var(--hk-sidebar-width);
    z-index: 1030;
    box-shadow: 4px 0 20px rgba(8,21,48,.12);
    transition: width var(--hk-transition), transform var(--hk-transition);
}

.app-layout.sidebar-collapsed .app-sidebar {
    width: var(--hk-sidebar-width-mini);
}

.sidebar-header {
    padding: 16px 20px;
    display: flex; align-items: center; gap: 12px;
    border-bottom: 1px solid rgba(255,255,255,.08);
    height: var(--hk-header-height);
}
.sidebar-logo {
    width: 38px; height: 38px;
    border-radius: 9px;
    display: block;
    object-fit: contain;
    flex-shrink: 0;
    box-shadow: 0 4px 12px rgba(46,157,63,.35);
}
.sidebar-brand {
    line-height: 1.15; overflow: hidden; white-space: nowrap;
    transition: opacity var(--hk-transition);
}
.sidebar-brand strong {
    display: block; color: #fff;
    font-weight: 800; font-size: 16px;
    letter-spacing: -.01em;
}
.sidebar-brand span {
    color: rgba(197,232,203,.85);
    font-size: 10.5px; letter-spacing: .12em; text-transform: uppercase;
}

.app-layout.sidebar-collapsed .sidebar-brand,
.app-layout.sidebar-collapsed .sidebar-section-title,
.app-layout.sidebar-collapsed .sidebar-link span,
.app-layout.sidebar-collapsed .sidebar-link .badge {
    opacity: 0;
    visibility: hidden;
    width: 0;
}

.sidebar-nav {
    flex: 1;
    overflow-y: auto;
    padding: 12px 12px 24px;
    scrollbar-width: thin;
}
.sidebar-nav::-webkit-scrollbar { width: 4px; }
.sidebar-nav::-webkit-scrollbar-thumb { background: rgba(255,255,255,.15); }

.sidebar-section-title {
    color: rgba(197,232,203,.5);
    font-size: 10px; font-weight: 700; letter-spacing: .14em;
    text-transform: uppercase;
    padding: 16px 12px 8px;
    transition: opacity var(--hk-transition);
}
.sidebar-section-title:first-child { padding-top: 4px; }

.sidebar-link {
    display: flex; align-items: center; gap: 12px;
    padding: 10px 12px;
    color: rgba(255,255,255,.78);
    text-decoration: none;
    font-size: 13.5px;
    font-weight: 500;
    border-radius: var(--hk-radius-sm);
    margin-bottom: 2px;
    position: relative;
    transition: all var(--hk-transition);
    white-space: nowrap;
    overflow: hidden;
}
.sidebar-link:hover {
    background: rgba(255,255,255,.07);
    color: #fff;
}
.sidebar-link i {
    font-size: 18px;
    width: 22px; text-align: center;
    flex-shrink: 0;
    transition: color var(--hk-transition);
}
.sidebar-link span { flex: 1; transition: opacity var(--hk-transition); }
.sidebar-link .badge {
    background: var(--hk-secondary);
    color: #fff;
    font-size: 10px; padding: 2px 8px;
    border-radius: 10px; font-weight: 700;
}

.sidebar-link.active {
    background: linear-gradient(90deg, var(--hk-secondary) 0%, rgba(46,157,63,.25) 100%);
    color: #fff;
    box-shadow: 0 4px 12px rgba(46,157,63,.32);
}
.sidebar-link.active::before {
    content: ''; position: absolute; left: -12px; top: 8px; bottom: 8px;
    width: 4px; background: var(--hk-secondary-light); border-radius: 0 4px 4px 0;
}

.sidebar-footer {
    padding: 16px 20px;
    border-top: 1px solid rgba(255,255,255,.08);
    display: flex; align-items: center; gap: 12px;
    transition: padding var(--hk-transition);
}
.app-layout.sidebar-collapsed .sidebar-footer { padding: 12px 16px; }
.sidebar-footer-avatar {
    width: 36px; height: 36px;
    background: linear-gradient(135deg, var(--hk-secondary) 0%, var(--hk-primary-light) 100%);
    border-radius: 50%;
    color: #fff; font-weight: 700; font-size: 13px;
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
    border: 2px solid rgba(255,255,255,.15);
}
.sidebar-footer-info { line-height: 1.2; overflow: hidden; transition: opacity var(--hk-transition); }
.sidebar-footer-info strong { color: #fff; font-size: 12.5px; display: block; }
.sidebar-footer-info span { color: rgba(255,255,255,.55); font-size: 10.5px; }
.app-layout.sidebar-collapsed .sidebar-footer-info { opacity: 0; visibility: hidden; width: 0; }

/* ----- Top header ----- */
.app-header {
    grid-area: header;
    background: var(--hk-surface);
    border-bottom: 1px solid var(--hk-border);
    height: var(--hk-header-height);
    padding: 0 24px;
    display: flex; align-items: center; gap: 16px;
    position: sticky; top: 0;
    z-index: 1020;
    box-shadow: var(--hk-shadow-xs);
}

.sidebar-toggle {
    background: transparent;
    border: 0;
    color: var(--hk-text-muted);
    font-size: 22px;
    width: 40px; height: 40px;
    border-radius: var(--hk-radius-sm);
    display: inline-flex; align-items: center; justify-content: center;
    cursor: pointer;
    transition: all var(--hk-transition);
}
.sidebar-toggle:hover { background: var(--hk-bg); color: var(--hk-primary); }

.header-breadcrumb {
    flex: 1; min-width: 0;
    display: flex; align-items: center;
    color: var(--hk-text-soft);
    font-size: 13px;
    overflow: hidden;
}
.header-breadcrumb .crumb {
    display: inline-flex; align-items: center;
    color: var(--hk-text-muted);
}
.header-breadcrumb .crumb.current { color: var(--hk-text); font-weight: 600; }
.header-breadcrumb .crumb-sep {
    margin: 0 8px;
    color: var(--hk-border-strong);
}

.header-search {
    flex: 0 0 320px;
    position: relative;
}
.header-search input {
    width: 100%;
    height: 40px;
    padding: 0 14px 0 40px;
    border-radius: var(--hk-radius-sm);
    border: 1.5px solid var(--hk-border);
    background: var(--hk-bg);
    font-size: 13px;
    transition: all var(--hk-transition);
}
.header-search input:focus {
    outline: none;
    background: var(--hk-surface);
    border-color: var(--hk-primary);
    box-shadow: var(--hk-shadow-focus);
}
.header-search i {
    position: absolute; left: 14px; top: 50%;
    transform: translateY(-50%);
    color: var(--hk-text-soft);
    font-size: 16px;
}
.header-search .kbd-hint {
    position: absolute; right: 12px; top: 50%; transform: translateY(-50%);
    color: var(--hk-text-soft); font-size: 11px;
    background: var(--hk-surface); padding: 2px 6px; border-radius: 4px;
    border: 1px solid var(--hk-border);
    font-family: var(--hk-font-mono);
}

.header-actions {
    display: flex; align-items: center; gap: 4px;
}
.header-icon-btn {
    width: 40px; height: 40px;
    border-radius: var(--hk-radius-sm);
    background: transparent;
    border: 0;
    color: var(--hk-text-muted);
    display: inline-flex; align-items: center; justify-content: center;
    cursor: pointer; position: relative;
    transition: all var(--hk-transition);
    font-size: 18px;
}
.header-icon-btn:hover { background: var(--hk-bg); color: var(--hk-primary); }
.header-icon-btn .badge-dot {
    position: absolute; top: 8px; right: 8px;
    width: 8px; height: 8px;
    background: var(--hk-secondary);
    border: 2px solid var(--hk-surface);
    border-radius: 50%;
}
.header-icon-btn .badge-count {
    position: absolute; top: 6px; right: 4px;
    background: var(--hk-accent);
    color: #fff;
    font-size: 10px; font-weight: 700;
    padding: 1px 6px; border-radius: 10px;
    min-width: 18px; text-align: center;
}

.header-user {
    display: flex; align-items: center; gap: 12px;
    padding: 6px 12px 6px 6px;
    border-radius: 22px;
    cursor: pointer;
    transition: background var(--hk-transition);
    margin-left: 8px;
}
.header-user:hover { background: var(--hk-bg); }
.header-user-avatar {
    width: 36px; height: 36px;
    background: linear-gradient(135deg, var(--hk-primary) 0%, var(--hk-secondary) 100%);
    color: #fff;
    border-radius: 50%;
    display: inline-flex; align-items: center; justify-content: center;
    font-weight: 700; font-size: 13px;
}
.header-user-info { line-height: 1.15; }
.header-user-info strong { color: var(--hk-text); font-size: 13px; display: block; }
.header-user-info span { color: var(--hk-text-soft); font-size: 11px; }

/* ----- Main content ----- */
.app-main {
    grid-area: main;
    padding: var(--hk-content-padding);
    overflow-y: auto;
    min-width: 0;
}

.page-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 16px;
    margin-bottom: 24px;
}
.page-header h1 {
    font-size: 24px; font-weight: 800;
    margin: 0 0 4px;
    color: var(--hk-text);
}
.page-header .page-subtitle {
    color: var(--hk-text-muted);
    font-size: 13.5px;
}
.page-header-actions {
    display: flex; align-items: center; gap: 8px;
    flex-wrap: wrap;
}

/* ----- Cards ----- */
.hk-card {
    background: var(--hk-surface);
    border: 1px solid var(--hk-border);
    border-radius: var(--hk-radius);
    box-shadow: var(--hk-shadow-xs);
    overflow: hidden;
}
.hk-card-header {
    padding: 18px 22px;
    border-bottom: 1px solid var(--hk-border);
    display: flex; align-items: center; justify-content: space-between;
    gap: 12px;
}
.hk-card-header h3, .hk-card-header h4 { margin: 0; font-size: 15px; font-weight: 700; }
.hk-card-header .subtitle { color: var(--hk-text-muted); font-size: 12px; font-weight: 400; margin-top: 2px; }
.hk-card-body { padding: 22px; }
.hk-card-footer {
    padding: 14px 22px;
    border-top: 1px solid var(--hk-border);
    background: var(--hk-surface-2);
    display: flex; align-items: center; justify-content: space-between;
}

/* ----- KPI Cards ----- */
.kpi-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin-bottom: 24px;
}
.kpi-card {
    background: var(--hk-surface);
    border: 1px solid var(--hk-border);
    border-radius: var(--hk-radius);
    padding: 20px;
    box-shadow: var(--hk-shadow-xs);
    position: relative;
    overflow: hidden;
    transition: all var(--hk-transition);
}
.kpi-card:hover {
    box-shadow: var(--hk-shadow);
    transform: translateY(-2px);
    border-color: var(--hk-border-strong);
}
.kpi-card::before {
    content: ''; position: absolute; left: 0; top: 0; bottom: 0;
    width: 4px;
    background: var(--accent-bar, var(--hk-primary));
    opacity: .85;
}
.kpi-card.kpi-primary  { --accent-bar: var(--hk-primary); }
.kpi-card.kpi-success  { --accent-bar: var(--hk-secondary); }
.kpi-card.kpi-warning  { --accent-bar: var(--hk-accent); }
.kpi-card.kpi-info     { --accent-bar: var(--hk-info); }
.kpi-card.kpi-danger   { --accent-bar: var(--hk-danger); }

.kpi-card .kpi-icon {
    position: absolute;
    top: 16px; right: 16px;
    width: 44px; height: 44px;
    border-radius: var(--hk-radius-sm);
    background: var(--hk-info-light);
    color: var(--hk-primary);
    display: inline-flex; align-items: center; justify-content: center;
    font-size: 22px;
}
.kpi-card.kpi-success .kpi-icon { background: var(--hk-secondary-light); color: var(--hk-secondary-dark); }
.kpi-card.kpi-warning .kpi-icon { background: var(--hk-accent-light); color: var(--hk-accent); }
.kpi-card.kpi-info .kpi-icon { background: #DCEBF8; color: var(--hk-info); }
.kpi-card.kpi-danger .kpi-icon { background: #FBE3E6; color: var(--hk-danger); }

.kpi-card .kpi-label {
    color: var(--hk-text-muted);
    font-size: 12px; font-weight: 600;
    letter-spacing: .04em; text-transform: uppercase;
}
.kpi-card .kpi-value {
    font-size: 32px; font-weight: 800;
    color: var(--hk-text);
    margin: 4px 0 0;
    line-height: 1.1;
    font-family: var(--hk-font-mono);
}
.kpi-card .kpi-trend {
    display: inline-flex; align-items: center; gap: 4px;
    font-size: 11.5px; font-weight: 600;
    margin-top: 8px;
    padding: 2px 8px;
    border-radius: 12px;
}
.kpi-card .kpi-trend.up   { color: var(--hk-secondary-dark); background: var(--hk-secondary-light); }
.kpi-card .kpi-trend.down { color: var(--hk-danger); background: #FBE3E6; }
.kpi-card .kpi-trend.flat { color: var(--hk-text-muted); background: var(--hk-bg); }
.kpi-card .kpi-subtitle {
    color: var(--hk-text-soft);
    font-size: 11px;
    margin-top: 6px;
}

/* ----- Status badges (PDF 8.4.2) ----- */
.hk-badge {
    display: inline-flex; align-items: center; gap: 5px;
    font-size: 11px; font-weight: 700;
    padding: 3px 9px;
    border-radius: 12px;
    line-height: 1.6;
    letter-spacing: .02em;
    border: 1px solid transparent;
}
.hk-badge i { font-size: 11px; }
.hk-badge-success { background: var(--hk-secondary-light); color: var(--hk-secondary-dark); border-color: rgba(46,157,63,.25); }
.hk-badge-info { background: var(--hk-info-light); color: var(--hk-primary); border-color: rgba(27,58,107,.25); }
.hk-badge-warning { background: var(--hk-accent-light); color: #B86E00; border-color: rgba(243,156,18,.3); }
.hk-badge-danger { background: #FBE3E6; color: var(--hk-danger); border-color: rgba(220,53,69,.25); }
.hk-badge-neutral { background: #EEF1F6; color: var(--hk-text-muted); border-color: var(--hk-border); }
.hk-badge-primary { background: var(--hk-primary); color: #fff; border-color: var(--hk-primary-dark); }
.hk-badge-secondary { background: var(--hk-secondary); color: #fff; border-color: var(--hk-secondary-dark); }
.hk-badge .dot {
    width: 6px; height: 6px; border-radius: 50%;
    background: currentColor; display: inline-block;
}

/* ----- Tables ----- */
.hk-table-wrap {
    background: var(--hk-surface);
    border: 1px solid var(--hk-border);
    border-radius: var(--hk-radius);
    overflow: hidden;
    box-shadow: var(--hk-shadow-xs);
}
.hk-table-toolbar {
    padding: 14px 22px;
    border-bottom: 1px solid var(--hk-border);
    background: var(--hk-surface-2);
    display: flex; align-items: center; justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
}
.hk-table-toolbar .filter-chips {
    display: flex; align-items: center; gap: 8px;
    flex-wrap: wrap;
    color: var(--hk-text-muted);
    font-size: 12.5px;
}
.filter-chip {
    background: var(--hk-info-light);
    color: var(--hk-primary);
    padding: 3px 10px; border-radius: 12px;
    font-size: 11.5px; font-weight: 600;
    display: inline-flex; align-items: center; gap: 6px;
}
.filter-chip button {
    background: transparent; border: 0; color: var(--hk-primary);
    cursor: pointer; padding: 0; line-height: 1;
    font-size: 14px;
}

.hk-table-toolbar .toolbar-actions {
    display: flex; gap: 8px;
}

.hk-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13.5px;
}
.hk-table thead th {
    background: var(--hk-surface-2);
    color: var(--hk-text-muted);
    text-transform: uppercase;
    letter-spacing: .05em;
    font-size: 11px;
    font-weight: 700;
    padding: 14px 18px;
    border-bottom: 1px solid var(--hk-border);
    text-align: left;
    white-space: nowrap;
}
.hk-table tbody td {
    padding: 14px 18px;
    border-bottom: 1px solid var(--hk-border);
    color: var(--hk-text);
    vertical-align: middle;
}
.hk-table tbody tr:last-child td { border-bottom: 0; }
.hk-table tbody tr { transition: background var(--hk-transition); }
.hk-table tbody tr:hover { background: var(--hk-surface-2); }
.hk-table .cell-code { font-family: var(--hk-font-mono); font-weight: 600; color: var(--hk-primary); font-size: 12.5px; }
.hk-table .cell-num { font-family: var(--hk-font-mono); text-align: right; font-feature-settings: "tnum"; }
.hk-table .cell-actions { text-align: right; white-space: nowrap; }
.hk-table .cell-actions a, .hk-table .cell-actions button {
    width: 30px; height: 30px;
    border-radius: var(--hk-radius-xs);
    background: transparent; border: 0;
    color: var(--hk-text-soft);
    display: inline-flex; align-items: center; justify-content: center;
    margin-left: 2px;
    transition: all var(--hk-transition);
}
.hk-table .cell-actions a:hover, .hk-table .cell-actions button:hover {
    background: var(--hk-info-light);
    color: var(--hk-primary);
}

.hk-table-footer {
    padding: 14px 22px;
    border-top: 1px solid var(--hk-border);
    background: var(--hk-surface-2);
    display: flex; align-items: center; justify-content: space-between;
    color: var(--hk-text-muted);
    font-size: 12.5px;
}
.hk-pagination { display: flex; gap: 4px; align-items: center; }
.hk-pagination button {
    width: 34px; height: 34px;
    border-radius: var(--hk-radius-xs);
    background: transparent;
    border: 1px solid transparent;
    color: var(--hk-text-muted);
    font-size: 12.5px; font-weight: 600;
    cursor: pointer;
    transition: all var(--hk-transition);
}
.hk-pagination button.active {
    background: var(--hk-primary); color: #fff; border-color: var(--hk-primary);
}
.hk-pagination button:hover:not(.active) {
    background: var(--hk-info-light); color: var(--hk-primary);
}

/* ----- Dashboard sections ----- */
.dash-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 16px;
    margin-bottom: 24px;
}
.dash-grid.cols-3 { grid-template-columns: 1fr 1fr 1fr; }
.dash-grid.cols-1-2 { grid-template-columns: 1fr 2fr; }
.dash-grid.equal { grid-template-columns: 1fr 1fr; }

.task-list {
    display: flex; flex-direction: column;
    padding: 8px 0;
}
.task-item {
    display: flex; align-items: flex-start; gap: 12px;
    padding: 12px 22px;
    border-left: 3px solid transparent;
    transition: all var(--hk-transition);
    cursor: pointer;
}
.task-item:hover { background: var(--hk-surface-2); border-left-color: var(--hk-primary); }
.task-item .task-dot {
    width: 10px; height: 10px;
    border-radius: 50%;
    margin-top: 6px;
    flex-shrink: 0;
}
.task-item.priority-high .task-dot { background: var(--hk-danger); box-shadow: 0 0 0 4px rgba(220,53,69,.18); }
.task-item.priority-medium .task-dot { background: var(--hk-accent); }
.task-item.priority-low .task-dot { background: var(--hk-info); }

.task-content { flex: 1; min-width: 0; }
.task-content .task-title { font-weight: 600; color: var(--hk-text); margin-bottom: 3px; font-size: 13.5px; }
.task-content .task-desc { color: var(--hk-text-muted); font-size: 12px; }
.task-meta {
    display: flex; align-items: center; gap: 10px;
    color: var(--hk-text-soft); font-size: 11.5px;
    margin-top: 6px;
}
.task-meta span { display: inline-flex; align-items: center; gap: 4px; }

.bar-row {
    display: flex; align-items: center; gap: 14px;
    margin-bottom: 12px;
    font-size: 13px;
}
.bar-row .bar-label {
    flex: 0 0 110px;
    color: var(--hk-text);
    font-weight: 600;
    display: flex; align-items: center; gap: 8px;
}
.bar-row .bar-track {
    flex: 1;
    height: 10px; background: var(--hk-bg);
    border-radius: 8px; overflow: hidden;
    border: 1px solid var(--hk-border);
}
.bar-row .bar-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--hk-secondary) 0%, var(--hk-primary-light) 120%);
    border-radius: 8px;
    transition: width 1s ease-out;
}
.bar-row .bar-value {
    flex: 0 0 60px;
    text-align: right;
    color: var(--hk-text-muted);
    font-family: var(--hk-font-mono);
    font-weight: 600;
}

/* ----- Buttons advanced ----- */
.btn-pill {
    border-radius: 999px;
    padding: 7px 14px;
    font-size: 12.5px;
    font-weight: 600;
}
.btn-icon { display: inline-flex; align-items: center; gap: 6px; }
.btn-icon i { font-size: 15px; }

/* ----- Section title divider ----- */
.section-title {
    display: flex; align-items: center; gap: 12px;
    color: var(--hk-text);
    font-weight: 700; font-size: 15px;
    margin: 8px 0 14px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--hk-border);
}
.section-title i {
    color: var(--hk-primary);
    width: 28px; height: 28px;
    background: var(--hk-info-light);
    border-radius: var(--hk-radius-xs);
    display: inline-flex; align-items: center; justify-content: center;
    font-size: 14px;
}

/* ----- Form layout ----- */
.hk-form-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
}
.hk-form-grid.cols-3 { grid-template-columns: repeat(3, 1fr); }
.hk-form-grid .col-full { grid-column: 1 / -1; }
.hk-form-group label {
    display: block;
    font-size: 12.5px; font-weight: 600;
    color: var(--hk-text-muted);
    margin-bottom: 6px;
    letter-spacing: .02em;
}
.hk-form-group label .req { color: var(--hk-danger); }
.hk-form-group .form-control,
.hk-form-group .form-select { font-size: 14px; padding: 10px 12px; }
.hk-form-group .form-hint {
    font-size: 11.5px;
    color: var(--hk-text-soft);
    margin-top: 4px;
}

/* ----- Pedigree tree (D3 host) ----- */
.pedigree-canvas {
    width: 100%;
    min-height: 520px;
    background:
        radial-gradient(at top right, rgba(46,157,63,.04) 0, transparent 40%),
        var(--hk-surface);
    border: 1px solid var(--hk-border);
    border-radius: var(--hk-radius);
    position: relative;
    overflow: hidden;
}
.pedigree-canvas svg { width: 100%; height: 100%; display: block; }
.pedigree-node-rect { transition: all var(--hk-transition); cursor: pointer; }
.pedigree-node-rect:hover { filter: brightness(1.05); }

/* ----- Activity feed ----- */
.activity-feed {
    display: flex; flex-direction: column;
}
.activity-item {
    display: flex; gap: 14px;
    padding: 14px 22px;
    border-bottom: 1px solid var(--hk-border);
    transition: background var(--hk-transition);
}
.activity-item:hover { background: var(--hk-surface-2); }
.activity-item:last-child { border-bottom: 0; }
.activity-icon {
    width: 36px; height: 36px;
    border-radius: var(--hk-radius-sm);
    flex-shrink: 0;
    display: inline-flex; align-items: center; justify-content: center;
    font-size: 16px;
}
.activity-icon.info { background: var(--hk-info-light); color: var(--hk-primary); }
.activity-icon.success { background: var(--hk-secondary-light); color: var(--hk-secondary-dark); }
.activity-icon.warning { background: var(--hk-accent-light); color: var(--hk-accent); }
.activity-icon.danger { background: #FBE3E6; color: var(--hk-danger); }
.activity-content { flex: 1; min-width: 0; }
.activity-content .activity-title { font-weight: 600; color: var(--hk-text); font-size: 13.5px; }
.activity-content .activity-meta { color: var(--hk-text-soft); font-size: 11.5px; margin-top: 2px; }
.activity-content .activity-desc { color: var(--hk-text-muted); font-size: 12.5px; margin-top: 4px; }

/* ----- Sync indicator ----- */
.sync-indicator {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 11.5px; font-weight: 600;
}
.sync-indicator .dot { width: 8px; height: 8px; border-radius: 50%; }
.sync-indicator.online { background: var(--hk-secondary-light); color: var(--hk-secondary-dark); }
.sync-indicator.online .dot { background: var(--hk-secondary); animation: pulse 1.8s ease-in-out infinite; }
.sync-indicator.offline { background: #EEF1F6; color: var(--hk-text-muted); }
.sync-indicator.offline .dot { background: var(--hk-text-soft); }
.sync-indicator.pending { background: var(--hk-accent-light); color: #B86E00; }
.sync-indicator.pending .dot { background: var(--hk-accent); animation: pulse 1.4s ease-in-out infinite; }

@keyframes pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: .6; transform: scale(1.4); }
}

/* ----- Stat tile (compact) ----- */
.stat-tile {
    display: flex; align-items: center; gap: 14px;
    padding: 14px;
    background: var(--hk-surface);
    border: 1px solid var(--hk-border);
    border-radius: var(--hk-radius-sm);
    transition: all var(--hk-transition);
}
.stat-tile:hover { box-shadow: var(--hk-shadow-sm); border-color: var(--hk-border-strong); }
.stat-tile .stat-icon {
    width: 44px; height: 44px;
    border-radius: var(--hk-radius-sm);
    background: var(--hk-info-light);
    color: var(--hk-primary);
    display: inline-flex; align-items: center; justify-content: center;
    font-size: 20px; flex-shrink: 0;
}
.stat-tile .stat-info { line-height: 1.25; }
.stat-tile .stat-info strong { font-size: 18px; color: var(--hk-text); display: block; font-family: var(--hk-font-mono); }
.stat-tile .stat-info span { color: var(--hk-text-muted); font-size: 11.5px; }

/* ----- Detail panel ----- */
.detail-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 20px;
}
.detail-key { color: var(--hk-text-muted); font-size: 12px; font-weight: 600; letter-spacing: .02em; text-transform: uppercase; }
.detail-val { font-weight: 600; color: var(--hk-text); font-size: 14px; }

/* ----- Generation cards (visual lab) ----- */
.gen-card {
    background: var(--hk-surface);
    border: 1px solid var(--hk-border);
    border-radius: var(--hk-radius);
    padding: 18px;
    position: relative;
    box-shadow: var(--hk-shadow-xs);
    transition: all var(--hk-transition);
}
.gen-card:hover { box-shadow: var(--hk-shadow); border-color: var(--hk-border-strong); transform: translateY(-2px); }
.gen-card .gen-pill {
    position: absolute; top: -10px; left: 18px;
    background: linear-gradient(135deg, var(--hk-primary) 0%, var(--hk-primary-light) 100%);
    color: #fff; font-weight: 800; font-size: 11px;
    padding: 4px 12px; border-radius: 12px; letter-spacing: .05em;
    box-shadow: var(--hk-shadow-sm);
}
.gen-card.gen-fixed .gen-pill { background: linear-gradient(135deg, var(--hk-secondary) 0%, #3FBA53 100%); }

/* ----- Tabs ----- */
.hk-tabs {
    display: flex; gap: 0;
    border-bottom: 1px solid var(--hk-border);
    margin-bottom: 18px;
}
.hk-tab {
    padding: 12px 18px;
    color: var(--hk-text-muted);
    font-weight: 600;
    font-size: 13px;
    text-decoration: none;
    border-bottom: 2px solid transparent;
    transition: all var(--hk-transition);
    background: transparent; border-top: 0; border-left: 0; border-right: 0;
    cursor: pointer;
    display: inline-flex; align-items: center; gap: 8px;
}
.hk-tab:hover { color: var(--hk-primary); }
.hk-tab.active {
    color: var(--hk-primary);
    border-bottom-color: var(--hk-primary);
}
.hk-tab .count {
    background: var(--hk-bg);
    color: var(--hk-text-muted);
    padding: 1px 8px; border-radius: 10px;
    font-size: 11px; font-weight: 700;
}
.hk-tab.active .count { background: var(--hk-info-light); color: var(--hk-primary); }

/* ----- Field mode helpers (mobile) ----- */
.field-screen {
    background: linear-gradient(180deg, var(--hk-primary-dark) 0%, var(--hk-primary) 60%, var(--hk-bg) 60%);
    min-height: 100vh;
    padding: 0;
}
.field-topbar {
    color: #fff; padding: 18px 20px;
    display: flex; align-items: center; justify-content: space-between;
}
.field-topbar .brand-mark-text strong { color: #fff; }
.field-topbar .brand-mark-text span { color: var(--hk-secondary-light); }

.field-card {
    background: var(--hk-surface);
    border-radius: var(--hk-radius-lg);
    padding: 20px;
    margin: 16px 16px;
    box-shadow: var(--hk-shadow);
}

.field-touch-grid {
    display: grid; grid-template-columns: 1fr 1fr; gap: 12px;
    padding: 0 16px;
}
.field-touch-card {
    background: var(--hk-surface);
    border: 1px solid var(--hk-border);
    padding: 22px 16px;
    border-radius: var(--hk-radius);
    text-align: center;
    cursor: pointer;
    transition: all var(--hk-transition);
    color: var(--hk-text);
    text-decoration: none;
}
.field-touch-card:hover { transform: translateY(-2px); box-shadow: var(--hk-shadow); }
.field-touch-card i {
    font-size: 32px; display: block; margin-bottom: 8px;
    color: var(--hk-primary);
}
.field-touch-card.accent-green i { color: var(--hk-secondary); }
.field-touch-card.accent-orange i { color: var(--hk-accent); }
.field-touch-card.accent-blue i { color: var(--hk-info); }
.field-touch-card strong { display: block; font-size: 14px; }
.field-touch-card span { color: var(--hk-text-soft); font-size: 11px; }

/* ----- Scanner overlay ----- */
.scanner-stage {
    position: relative;
    background: #0d1b2a;
    border-radius: var(--hk-radius-lg);
    overflow: hidden;
    aspect-ratio: 4/3;
    box-shadow: var(--hk-shadow-lg);
}
.scanner-stage video {
    width: 100%; height: 100%; object-fit: cover; display: block;
}
.scanner-overlay {
    position: absolute; inset: 0;
    display: flex; align-items: center; justify-content: center;
    pointer-events: none;
}
.scanner-frame {
    width: 70%; max-width: 380px;
    aspect-ratio: 1.6/1;
    border: 3px solid rgba(46,157,63,.95);
    border-radius: 14px;
    box-shadow: 0 0 0 9999px rgba(0,0,0,.55);
    position: relative;
}
.scanner-frame::before, .scanner-frame::after,
.scanner-frame .c-tr, .scanner-frame .c-bl, .scanner-frame .c-br {
    content: ''; position: absolute; width: 24px; height: 24px;
    border: 3px solid var(--hk-secondary-light);
}
.scanner-frame::before { top:-3px; left:-3px; border-right:0; border-bottom:0; border-top-left-radius: 14px; }
.scanner-frame::after { bottom:-3px; right:-3px; border-left:0; border-top:0; border-bottom-right-radius: 14px; }
.scanner-frame .c-tr { top:-3px; right:-3px; border-left:0; border-bottom:0; border-top-right-radius: 14px; }
.scanner-frame .c-bl { bottom:-3px; left:-3px; border-right:0; border-top:0; border-bottom-left-radius: 14px; }
.scanner-line {
    position: absolute;
    top: 0; left: 8%; right: 8%;
    height: 3px;
    background: linear-gradient(90deg, transparent, var(--hk-secondary-light), transparent);
    box-shadow: 0 0 12px var(--hk-secondary-light);
    animation: scanline 2.4s ease-in-out infinite;
}
@keyframes scanline {
    0% { top: 5%; }
    50% { top: 95%; }
    100% { top: 5%; }
}

.scanner-bottom-bar {
    position: absolute; left: 0; right: 0; bottom: 0;
    padding: 16px;
    display: flex; align-items: center; justify-content: space-between;
    color: #fff;
    background: linear-gradient(180deg, transparent 0%, rgba(0,0,0,.6) 100%);
    pointer-events: none;
}
.scanner-status {
    display: inline-flex; align-items: center; gap: 8px;
    background: rgba(46,157,63,.18);
    color: var(--hk-secondary-light);
    padding: 6px 12px; border-radius: 14px;
    font-size: 12px; font-weight: 600;
}
.scanner-status .pulse-dot {
    width: 8px; height: 8px; border-radius: 50%;
    background: var(--hk-secondary-light);
    animation: pulse 1.4s ease-in-out infinite;
}

.scanner-actions {
    display: flex; gap: 8px;
    pointer-events: auto;
}
.scanner-action {
    background: rgba(255,255,255,.12);
    border: 1px solid rgba(255,255,255,.2);
    color: #fff;
    padding: 8px 14px;
    border-radius: 22px;
    font-size: 12px; font-weight: 600;
    cursor: pointer;
    display: inline-flex; align-items: center; gap: 6px;
    backdrop-filter: blur(8px);
    transition: background var(--hk-transition);
}
.scanner-action:hover { background: rgba(255,255,255,.22); }

/* ----- AI Disease Score ----- */
.disease-score-result {
    background: linear-gradient(135deg, #FFF8EC 0%, #FFE5C8 100%);
    border: 1px solid rgba(243,156,18,.3);
    border-radius: var(--hk-radius);
    padding: 22px;
}
.disease-score-result.score-low {
    background: linear-gradient(135deg, #E9F8EC 0%, #C5E8CB 100%);
    border-color: rgba(46,157,63,.3);
}
.disease-score-result.score-high {
    background: linear-gradient(135deg, #FCE9EB 0%, #F8BFC5 100%);
    border-color: rgba(220,53,69,.3);
}
.disease-score-result h3 {
    font-size: 14px; color: var(--hk-text-muted);
    text-transform: uppercase; letter-spacing: .06em;
    font-weight: 700; margin-bottom: 8px;
}
.disease-score-value {
    font-size: 56px; font-weight: 800;
    line-height: 1; margin-bottom: 8px;
    font-family: var(--hk-font-mono);
}
.score-low .disease-score-value { color: var(--hk-secondary-dark); }
.score-medium .disease-score-value { color: var(--hk-accent); }
.score-high .disease-score-value { color: var(--hk-danger); }

.metric-row {
    display: grid; grid-template-columns: 150px 1fr 60px;
    align-items: center; gap: 12px;
    padding: 8px 0;
    border-bottom: 1px dashed var(--hk-border);
}
.metric-row:last-child { border-bottom: 0; }
.metric-name { font-size: 12.5px; color: var(--hk-text-muted); font-weight: 600; }
.metric-bar { height: 8px; background: var(--hk-bg); border-radius: 6px; overflow: hidden; }
.metric-bar-fill {
    height: 100%; border-radius: 6px;
    background: linear-gradient(90deg, var(--hk-secondary) 0%, var(--hk-accent) 60%, var(--hk-danger) 100%);
    transition: width 0.8s ease-out;
}
.metric-value { text-align: right; font-family: var(--hk-font-mono); font-weight: 600; color: var(--hk-text); font-size: 12.5px; }

.score-buttons {
    display: grid; grid-template-columns: repeat(6, 1fr);
    gap: 8px; margin-top: 16px;
}
.score-btn {
    aspect-ratio: 1;
    border: 2px solid var(--hk-border);
    background: var(--hk-surface);
    border-radius: var(--hk-radius-sm);
    font-size: 22px; font-weight: 800;
    color: var(--hk-text-muted);
    cursor: pointer;
    transition: all var(--hk-transition);
    display: inline-flex; align-items: center; justify-content: center;
    font-family: var(--hk-font-mono);
}
.score-btn:hover { border-color: var(--hk-primary); color: var(--hk-primary); transform: scale(1.05); }
.score-btn.suggested { border-color: var(--hk-accent); color: var(--hk-accent); background: var(--hk-accent-light); }
.score-btn.selected { border-color: var(--hk-primary); background: var(--hk-primary); color: #fff; }

/* ----- AI heat strip (placeholder visual) ----- */
.heat-strip {
    height: 14px;
    border-radius: 8px;
    background: linear-gradient(90deg,
        #2E9D3F 0%, #C5E8CB 25%,
        #F39C12 50%, #FDEBC6 70%,
        #DC3545 100%);
    margin: 8px 0;
    border: 1px solid var(--hk-border);
}

/* ----- Login footer credit ----- */
.oyak-credit {
    display: inline-flex; align-items: center; gap: 8px;
    color: rgba(255,255,255,.5);
    font-size: 10px; letter-spacing: .15em;
    text-transform: uppercase;
}
.oyak-credit-mark {
    width: 22px; height: 22px;
    background: var(--hk-oyak-red);
    color: #fff; border-radius: 50%;
    display: inline-flex; align-items: center; justify-content: center;
    font-weight: 800; font-size: 9px;
    letter-spacing: 0;
}

/* ============== Responsive ============== */
/* Tablet */
@media (max-width: 1199px) {
    :root { --hk-sidebar-width: 240px; }
    .kpi-grid { grid-template-columns: repeat(2, 1fr); }
    .dash-grid { grid-template-columns: 1fr; }
    .dash-grid.cols-3 { grid-template-columns: 1fr 1fr; }
    .header-search { flex: 0 0 240px; }
}

@media (max-width: 991px) {
    .login-wrap { grid-template-columns: 1fr; max-width: 480px; }
    .login-hero { padding: 32px; min-height: 160px; }
    .login-hero h1 { font-size: 24px; }
    .login-hero .features, .login-hero-footer { display: none; }
    .login-form { padding: 32px 28px; }

    .app-layout {
        grid-template-columns: 0 1fr;
    }
    .app-sidebar {
        transform: translateX(-100%);
        width: 280px;
    }
    .app-layout.sidebar-open .app-sidebar {
        transform: translateX(0);
    }
    .app-layout.sidebar-open::before {
        content: '';
        position: fixed; inset: 0;
        background: rgba(15,38,71,.5);
        z-index: 1020;
    }
    .header-search { display: none; }
    .header-user-info { display: none; }
}

@media (max-width: 767px) {
    :root { --hk-content-padding: 16px; --hk-header-height: 60px; }
    .kpi-grid { grid-template-columns: 1fr; gap: 12px; }
    .page-header h1 { font-size: 20px; }
    .dash-grid.cols-3 { grid-template-columns: 1fr; }
    .hk-form-grid, .hk-form-grid.cols-3 { grid-template-columns: 1fr; }
    .detail-grid { grid-template-columns: 1fr; }
    .hk-card-body { padding: 16px; }
    .hk-card-header { padding: 14px 16px; }
    .hk-table-toolbar { padding: 12px 16px; }
    .hk-table thead th, .hk-table tbody td { padding: 10px 14px; font-size: 12.5px; }
    .demo-roles { grid-template-columns: 1fr; }
    .header-breadcrumb { display: none; }
}

/* Print */
@media print {
    .app-sidebar, .app-header, .page-header-actions { display: none !important; }
    .app-layout { grid-template-columns: 1fr; grid-template-areas: "main"; }
    .app-main { padding: 0; }
}

/* ============== Utilities ============== */
.text-muted-2 { color: var(--hk-text-soft); }
.text-primary-hk { color: var(--hk-primary) !important; }
.text-secondary-hk { color: var(--hk-secondary) !important; }
.bg-soft-primary { background: var(--hk-info-light); }
.bg-soft-success { background: var(--hk-secondary-light); }
.bg-soft-warning { background: var(--hk-accent-light); }
.gap-mini { gap: 4px; }
.radius { border-radius: var(--hk-radius); }
.radius-sm { border-radius: var(--hk-radius-sm); }
.shadow-sm-hk { box-shadow: var(--hk-shadow-xs); }
.shadow-md-hk { box-shadow: var(--hk-shadow-sm); }
.fw-700 { font-weight: 700; }
.fw-800 { font-weight: 800; }

/* Mini chart placeholders */
.chart-wrap { width: 100%; min-height: 260px; position: relative; }
.chart-wrap canvas { max-width: 100%; }
.legend-row {
    display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
    font-size: 12px; color: var(--hk-text-muted);
    margin-top: 8px;
}
.legend-row span { display: inline-flex; align-items: center; gap: 6px; }
.legend-dot { width: 12px; height: 12px; border-radius: 3px; }

/* Print summary card for registry */
.summary-card {
    background: linear-gradient(135deg, var(--hk-primary) 0%, var(--hk-primary-light) 100%);
    color: #fff;
    border-radius: var(--hk-radius);
    padding: 22px;
    box-shadow: var(--hk-shadow);
    position: relative;
    overflow: hidden;
}
.summary-card::before {
    content: '';
    position: absolute; right: -40px; top: -40px;
    width: 200px; height: 200px;
    background: radial-gradient(circle, rgba(255,255,255,.12), transparent 70%);
}
.summary-card h3 { color: #fff; }
.summary-card .summary-grid {
    display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px;
    margin-top: 18px;
}
.summary-stat strong { display: block; font-size: 24px; font-weight: 800; font-family: var(--hk-font-mono); }
.summary-stat span { color: var(--hk-secondary-light); font-size: 11px; text-transform: uppercase; letter-spacing: .04em; }

@media (max-width: 767px) {
    .summary-card .summary-grid { grid-template-columns: repeat(2, 1fr); }
}

/* ============== Calendar ============== */
.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 0;
    border: 1px solid var(--hk-border);
    border-radius: var(--hk-radius);
    overflow: hidden;
    background: var(--hk-surface);
}
.calendar-grid .day-header {
    background: var(--hk-surface-2);
    padding: 10px 12px;
    font-size: 11px;
    font-weight: 700;
    color: var(--hk-text-muted);
    text-transform: uppercase;
    letter-spacing: .06em;
    border-bottom: 1px solid var(--hk-border);
    border-right: 1px solid var(--hk-border);
    text-align: center;
}
.calendar-grid .day-header:last-child { border-right: 0; }

.calendar-day {
    min-height: 130px;
    padding: 8px;
    border-right: 1px solid var(--hk-border);
    border-bottom: 1px solid var(--hk-border);
    position: relative;
    background: var(--hk-surface);
    transition: background var(--hk-transition);
    cursor: pointer;
}
.calendar-day:hover { background: var(--hk-bg); }
.calendar-day:nth-child(7n+8) { border-right: 0; }
.calendar-day.other-month {
    background: var(--hk-surface-2);
    opacity: .55;
}
.calendar-day.today {
    background: linear-gradient(180deg, rgba(46,157,63,.08) 0%, transparent 100%);
}
.calendar-day.today .day-number {
    background: var(--hk-secondary);
    color: #fff;
    width: 28px; height: 28px;
    border-radius: 50%;
    display: inline-flex; align-items: center; justify-content: center;
    font-weight: 800;
}
.calendar-day .day-number {
    font-weight: 700;
    color: var(--hk-text);
    font-size: 13px;
    margin-bottom: 6px;
    display: inline-block;
}
.calendar-day .day-number.weekend { color: var(--hk-danger); }
.calendar-event {
    display: block;
    padding: 3px 6px;
    margin: 2px 0;
    border-radius: 4px;
    font-size: 10.5px;
    font-weight: 600;
    color: #fff;
    background: var(--hk-primary);
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
    cursor: pointer;
    transition: opacity var(--hk-transition);
    text-decoration: none;
    line-height: 1.4;
}
.calendar-event:hover { opacity: .85; color: #fff; }
.calendar-event.more {
    background: var(--hk-surface-2);
    color: var(--hk-text-muted);
    text-align: center;
}

.calendar-mini-week {
    display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px;
    margin-top: 12px;
}
.calendar-mini-week > div {
    text-align: center;
    padding: 6px 4px;
    border-radius: 6px;
    background: var(--hk-surface-2);
    font-size: 11px;
}
.calendar-mini-week .day-name { font-weight: 700; color: var(--hk-text-muted); font-size: 9px; }
.calendar-mini-week .day-num { font-weight: 700; color: var(--hk-text); font-size: 14px; }
.calendar-mini-week .today { background: var(--hk-secondary); color: #fff; }
.calendar-mini-week .today .day-name { color: rgba(255,255,255,.85); }
.calendar-mini-week .today .day-num { color: #fff; }

/* Event detail row */
.event-list-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 12px 16px;
    border-left: 3px solid transparent;
    transition: all var(--hk-transition);
    cursor: pointer;
    border-bottom: 1px solid var(--hk-border);
}
.event-list-item:hover { background: var(--hk-surface-2); }
.event-list-item .event-time {
    flex: 0 0 80px;
    text-align: center;
    border-radius: var(--hk-radius-sm);
    padding: 6px 0;
    background: var(--hk-bg);
    color: var(--hk-text-muted);
    font-size: 11px;
    font-weight: 600;
}
.event-list-item .event-time strong { font-size: 16px; color: var(--hk-text); display: block; font-family: var(--hk-font-mono); }
.event-list-item .event-icon {
    width: 36px; height: 36px;
    border-radius: var(--hk-radius-sm);
    display: inline-flex; align-items: center; justify-content: center;
    color: #fff; font-size: 16px;
    flex-shrink: 0;
}
.event-list-item .event-content { flex: 1; }

/* ============== Kanban Board ============== */
.kanban-board {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    overflow-x: auto;
    padding-bottom: 6px;
}
.kanban-column {
    background: var(--hk-surface-2);
    border: 1px solid var(--hk-border);
    border-radius: var(--hk-radius);
    min-width: 280px;
    display: flex;
    flex-direction: column;
}
.kanban-column-header {
    padding: 14px 16px;
    border-bottom: 1px solid var(--hk-border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--hk-surface);
    border-radius: var(--hk-radius) var(--hk-radius) 0 0;
}
.kanban-column-header h4 {
    margin: 0;
    font-size: 13px;
    font-weight: 700;
    color: var(--hk-text);
    display: flex; align-items: center; gap: 8px;
}
.kanban-column-header h4::before {
    content: '';
    width: 10px; height: 10px;
    border-radius: 50%;
    background: var(--col-color, var(--hk-primary));
}
.kanban-column.col-pending { --col-color: var(--hk-text-muted); }
.kanban-column.col-progress { --col-color: var(--hk-info); }
.kanban-column.col-review { --col-color: var(--hk-accent); }
.kanban-column.col-done { --col-color: var(--hk-secondary); }
.kanban-column .col-count {
    background: var(--hk-bg);
    color: var(--hk-text-muted);
    font-size: 11px; font-weight: 700;
    padding: 2px 8px; border-radius: 10px;
}
.kanban-column-body {
    padding: 12px;
    flex: 1;
    overflow-y: auto;
    min-height: 200px;
    max-height: 70vh;
}
.kanban-card {
    background: var(--hk-surface);
    border: 1px solid var(--hk-border);
    border-left: 4px solid var(--card-accent, var(--hk-primary));
    border-radius: var(--hk-radius-sm);
    padding: 12px;
    margin-bottom: 10px;
    cursor: grab;
    transition: all var(--hk-transition);
    box-shadow: var(--hk-shadow-xs);
}
.kanban-card:hover {
    box-shadow: var(--hk-shadow);
    transform: translateY(-1px);
}
.kanban-card.prio-critical { --card-accent: var(--hk-danger); }
.kanban-card.prio-high { --card-accent: var(--hk-accent); }
.kanban-card.prio-medium { --card-accent: var(--hk-info); }
.kanban-card.prio-low { --card-accent: var(--hk-text-muted); }
.kanban-card .kc-code {
    font-family: var(--hk-font-mono);
    font-size: 10.5px;
    color: var(--hk-text-soft);
    font-weight: 600;
}
.kanban-card .kc-title {
    font-weight: 600;
    color: var(--hk-text);
    font-size: 13px;
    margin: 4px 0;
    line-height: 1.35;
}
.kanban-card .kc-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-top: 10px;
    padding-top: 8px;
    border-top: 1px dashed var(--hk-border);
}
.kanban-card .kc-meta .avatar {
    width: 22px; height: 22px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--hk-primary), var(--hk-secondary));
    color: #fff;
    font-size: 9.5px; font-weight: 700;
    display: inline-flex; align-items: center; justify-content: center;
}
.kanban-card .kc-meta-right {
    display: flex; align-items: center; gap: 8px;
    font-size: 11px; color: var(--hk-text-soft);
}
.kanban-card .kc-tags {
    display: flex; flex-wrap: wrap; gap: 4px;
    margin-top: 6px;
}
.kanban-card .kc-tag {
    background: var(--hk-info-light);
    color: var(--hk-primary);
    font-size: 9.5px;
    padding: 1px 6px;
    border-radius: 8px;
    font-weight: 600;
}
.kanban-card .kc-progress {
    height: 4px;
    background: var(--hk-bg);
    border-radius: 2px;
    margin-top: 8px;
    overflow: hidden;
}
.kanban-card .kc-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--hk-secondary), var(--hk-primary-light));
    border-radius: 2px;
}

@media (max-width: 1199px) {
    .kanban-board { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 767px) {
    .kanban-board { grid-template-columns: 1fr; }
}

/* ============== Workflow Visualization ============== */
.workflow-flow {
    display: flex;
    align-items: stretch;
    gap: 0;
    overflow-x: auto;
    padding: 14px 0;
}
.wf-step {
    flex: 1;
    min-width: 180px;
    background: var(--hk-surface);
    border: 1.5px solid var(--hk-border);
    border-radius: var(--hk-radius);
    padding: 14px;
    position: relative;
}
.wf-step.active {
    border-color: var(--hk-secondary);
    box-shadow: 0 0 0 3px rgba(46,157,63,.16);
}
.wf-step.approved {
    background: linear-gradient(135deg, var(--hk-secondary-light), #fff);
    border-color: var(--hk-secondary-dark);
}
.wf-step.rejected {
    background: #FBE3E6;
    border-color: var(--hk-danger);
}
.wf-step.waiting { background: var(--hk-bg); }
.wf-step + .wf-step::before {
    content: '';
    position: absolute;
    left: -16px; top: 50%;
    width: 16px; height: 2px;
    background: var(--hk-border-strong);
    transform: translateY(-50%);
}
.wf-step + .wf-step::after {
    content: '›';
    position: absolute;
    left: -10px; top: 50%;
    transform: translateY(-50%);
    color: var(--hk-border-strong);
    font-size: 18px;
    font-weight: 800;
}
.wf-step .wf-step-num {
    display: inline-flex;
    align-items: center; justify-content: center;
    width: 26px; height: 26px;
    border-radius: 50%;
    background: var(--hk-primary);
    color: #fff;
    font-size: 12px; font-weight: 700;
    margin-bottom: 6px;
}
.wf-step.approved .wf-step-num { background: var(--hk-secondary-dark); }
.wf-step.active .wf-step-num { background: var(--hk-secondary); animation: wfPulse 1.8s ease-in-out infinite; }
.wf-step.rejected .wf-step-num { background: var(--hk-danger); }
.wf-step.waiting .wf-step-num { background: var(--hk-text-soft); }
@keyframes wfPulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(46,157,63,.5); }
    50% { box-shadow: 0 0 0 8px rgba(46,157,63,0); }
}
.wf-step h5 {
    font-size: 13px; font-weight: 700;
    color: var(--hk-text);
    margin: 0 0 4px;
}
.wf-step .wf-role { color: var(--hk-text-muted); font-size: 11px; font-weight: 600; }
.wf-step .wf-approver { color: var(--hk-text); font-size: 12px; margin-top: 4px; }
.wf-step .wf-sla {
    margin-top: 8px;
    font-size: 10.5px;
    color: var(--hk-text-soft);
    display: flex; align-items: center; gap: 4px;
}

/* Workflow timeline */
.wf-timeline {
    border-left: 2px solid var(--hk-border);
    padding-left: 22px;
    margin-left: 12px;
}
.wf-timeline-item {
    position: relative;
    padding-bottom: 18px;
}
.wf-timeline-item::before {
    content: '';
    position: absolute;
    left: -29px; top: 4px;
    width: 14px; height: 14px;
    border-radius: 50%;
    background: var(--hk-border-strong);
    border: 2.5px solid var(--hk-surface);
}
.wf-timeline-item.approved::before { background: var(--hk-secondary); }
.wf-timeline-item.active::before {
    background: var(--hk-secondary);
    box-shadow: 0 0 0 4px rgba(46,157,63,.2);
}
.wf-timeline-item.rejected::before { background: var(--hk-danger); }

/* ============== File Manager ============== */
.file-toolbar {
    background: var(--hk-surface);
    border: 1px solid var(--hk-border);
    border-radius: var(--hk-radius);
    padding: 14px 18px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}
.file-path {
    display: flex;
    align-items: center;
    gap: 4px;
    color: var(--hk-text-muted);
    font-size: 12.5px;
    flex-wrap: wrap;
}
.file-path a { color: var(--hk-primary); font-weight: 600; }
.file-path .sep { color: var(--hk-border-strong); }

.file-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 14px;
}
.file-card {
    background: var(--hk-surface);
    border: 1px solid var(--hk-border);
    border-radius: var(--hk-radius);
    padding: 18px 14px;
    text-align: center;
    cursor: pointer;
    transition: all var(--hk-transition);
    text-decoration: none;
    color: var(--hk-text);
    display: block;
    position: relative;
}
.file-card:hover {
    border-color: var(--hk-primary);
    box-shadow: var(--hk-shadow);
    transform: translateY(-2px);
    color: var(--hk-text);
}
.file-card.folder { background: linear-gradient(135deg, var(--hk-info-light) 0%, #fff 100%); }
.file-card .file-icon {
    font-size: 44px;
    margin-bottom: 8px;
    display: block;
    line-height: 1;
    color: var(--icon-color, var(--hk-primary));
}
.file-card .file-name {
    font-weight: 600;
    font-size: 13px;
    color: var(--hk-text);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    line-height: 1.3;
}
.file-card .file-meta {
    color: var(--hk-text-soft);
    font-size: 11px;
    margin-top: 4px;
}
.file-card .file-badge {
    position: absolute;
    top: 8px; right: 8px;
    background: var(--hk-bg);
    color: var(--hk-text-muted);
    padding: 1px 7px;
    border-radius: 8px;
    font-size: 9.5px;
    font-weight: 700;
    border: 1px solid var(--hk-border);
}
.file-card .file-lock {
    position: absolute;
    top: 8px; left: 8px;
    color: var(--hk-accent);
    font-size: 14px;
}

.file-table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.file-table thead th {
    background: var(--hk-surface-2);
    padding: 12px 14px;
    color: var(--hk-text-muted);
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: .04em;
    border-bottom: 1px solid var(--hk-border);
    text-align: left;
}
.file-table tbody td {
    padding: 12px 14px;
    border-bottom: 1px solid var(--hk-border);
    vertical-align: middle;
}
.file-table tbody tr:hover { background: var(--hk-surface-2); }
.file-table .file-row-icon {
    width: 36px; height: 36px;
    border-radius: var(--hk-radius-sm);
    background: var(--hk-bg);
    display: inline-flex; align-items: center; justify-content: center;
    font-size: 18px;
    flex-shrink: 0;
}

/* Email outbox row */
.email-row {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 18px;
    border-bottom: 1px solid var(--hk-border);
    cursor: pointer;
    transition: background var(--hk-transition);
}
.email-row:hover { background: var(--hk-surface-2); }
.email-row.unread { background: var(--hk-info-light); }
.email-row.unread:hover { background: #C6D7EF; }
.email-row .email-status {
    width: 36px; height: 36px;
    border-radius: 50%;
    display: inline-flex; align-items: center; justify-content: center;
    flex-shrink: 0;
    color: #fff;
    font-size: 14px;
}
.email-row .email-status.sent { background: var(--hk-secondary); }
.email-row .email-status.queued { background: var(--hk-accent); }
.email-row .email-status.failed { background: var(--hk-danger); }
.email-row .email-status.read { background: var(--hk-text-soft); }

/* Reminder card */
.reminder-card {
    display: flex; align-items: flex-start; gap: 14px;
    padding: 14px;
    background: var(--hk-surface);
    border: 1px solid var(--hk-border);
    border-left: 4px solid var(--rem-color, var(--hk-info));
    border-radius: var(--hk-radius-sm);
    margin-bottom: 10px;
    transition: all var(--hk-transition);
}
.reminder-card.warning { --rem-color: var(--hk-accent); }
.reminder-card.danger { --rem-color: var(--hk-danger); }
.reminder-card.info { --rem-color: var(--hk-info); }
.reminder-card.sent { opacity: .7; background: var(--hk-bg); }
.reminder-card .rem-icon {
    width: 40px; height: 40px;
    border-radius: 50%;
    background: var(--rem-color, var(--hk-info));
    color: #fff;
    display: inline-flex; align-items: center; justify-content: center;
    flex-shrink: 0; font-size: 18px;
}

/* ============== Digital Twin ============== */
.twin-stage {
    width: 100%;
    height: 72vh;
    min-height: 560px;
    position: relative;
    background:
        radial-gradient(ellipse at 50% 0%, #87CEEB 0%, #B8DCEC 25%, #E8F2F8 60%, #F5F7FA 100%);
    border-radius: var(--hk-radius);
    overflow: hidden;
    box-shadow: var(--hk-shadow);
    cursor: grab;
}
.twin-stage:active { cursor: grabbing; }
.twin-stage canvas {
    display: block;
    width: 100% !important;
    height: 100% !important;
    outline: none;
}

.twin-overlay {
    position: absolute;
    top: 14px; left: 14px;
    background: rgba(15,38,71,.85);
    backdrop-filter: blur(8px);
    color: #fff;
    padding: 12px 16px;
    border-radius: var(--hk-radius-sm);
    font-size: 12px;
    z-index: 5;
    pointer-events: none;
    border: 1px solid rgba(255,255,255,.12);
    min-width: 200px;
}
.twin-overlay .ov-title {
    font-weight: 800;
    font-size: 13px;
    margin-bottom: 4px;
    color: var(--hk-secondary-light);
}
.twin-overlay .ov-row {
    display: flex; justify-content: space-between; gap: 12px;
    padding: 2px 0;
}
.twin-overlay .ov-row strong { color: #fff; font-family: var(--hk-font-mono); }
.twin-overlay .ov-row span { color: rgba(255,255,255,.65); }

.twin-controls {
    position: absolute;
    top: 14px; right: 14px;
    background: rgba(255,255,255,.95);
    backdrop-filter: blur(8px);
    border-radius: var(--hk-radius-sm);
    padding: 8px;
    box-shadow: var(--hk-shadow-sm);
    display: flex; flex-direction: column; gap: 4px;
    z-index: 5;
    border: 1px solid var(--hk-border);
}
.twin-controls button {
    width: 36px; height: 36px;
    border-radius: var(--hk-radius-xs);
    background: transparent;
    border: 0;
    color: var(--hk-text-muted);
    cursor: pointer;
    font-size: 16px;
    transition: all var(--hk-transition);
    display: inline-flex; align-items: center; justify-content: center;
}
.twin-controls button:hover {
    background: var(--hk-info-light);
    color: var(--hk-primary);
}
.twin-controls button.active {
    background: var(--hk-primary);
    color: #fff;
}

.twin-legend {
    position: absolute;
    bottom: 14px; left: 14px;
    background: rgba(255,255,255,.95);
    backdrop-filter: blur(8px);
    border-radius: var(--hk-radius-sm);
    padding: 10px 14px;
    box-shadow: var(--hk-shadow-sm);
    z-index: 5;
    font-size: 11.5px;
    border: 1px solid var(--hk-border);
}
.twin-legend .leg-title {
    font-weight: 700;
    font-size: 10.5px;
    color: var(--hk-text-muted);
    text-transform: uppercase;
    letter-spacing: .06em;
    margin-bottom: 6px;
}
.twin-legend .leg-row {
    display: flex; align-items: center; gap: 8px;
    padding: 3px 0;
}
.twin-legend .leg-dot {
    width: 14px; height: 14px;
    border-radius: 3px;
    box-shadow: 0 1px 2px rgba(0,0,0,.2);
}

.twin-fps {
    position: absolute;
    bottom: 14px; right: 14px;
    background: rgba(0,0,0,.6);
    color: #C5E8CB;
    padding: 4px 10px;
    border-radius: 12px;
    font-family: var(--hk-font-mono);
    font-size: 10.5px;
    z-index: 5;
    pointer-events: none;
}

.twin-side-panel {
    position: fixed;
    top: 0; right: -420px;
    width: 400px;
    height: 100vh;
    background: var(--hk-surface);
    box-shadow: -10px 0 40px rgba(15,38,71,.18);
    transition: right 0.3s cubic-bezier(.4,0,.2,1);
    z-index: 1050;
    overflow-y: auto;
}
.twin-side-panel.open { right: 0; }
.twin-side-panel-header {
    padding: 18px 22px;
    border-bottom: 1px solid var(--hk-border);
    background: linear-gradient(135deg, var(--hk-primary) 0%, var(--hk-primary-light) 100%);
    color: #fff;
}
.twin-side-panel-header .close-btn {
    position: absolute;
    top: 14px; right: 14px;
    background: rgba(255,255,255,.15);
    border: 0;
    color: #fff;
    width: 32px; height: 32px;
    border-radius: 50%;
    cursor: pointer;
}
.twin-side-panel-body { padding: 22px; }

.parcel-status-card {
    padding: 14px;
    border-radius: var(--hk-radius-sm);
    margin-bottom: 12px;
    border-left: 4px solid var(--ps-color, var(--hk-info));
    background: var(--ps-bg, var(--hk-info-light));
}
.parcel-status-card.healthy { --ps-color: var(--hk-secondary); --ps-bg: var(--hk-secondary-light); }
.parcel-status-card.warning { --ps-color: var(--hk-accent); --ps-bg: var(--hk-accent-light); }
.parcel-status-card.critical { --ps-color: var(--hk-danger); --ps-bg: #FBE3E6; }
.parcel-status-card.empty { --ps-color: var(--hk-text-muted); --ps-bg: var(--hk-bg); }

.sensor-card {
    background: var(--hk-surface);
    border: 1px solid var(--hk-border);
    border-radius: var(--hk-radius-sm);
    padding: 12px;
    display: flex;
    align-items: center;
    gap: 12px;
    transition: all var(--hk-transition);
}
.sensor-card:hover {
    border-color: var(--hk-primary);
    box-shadow: var(--hk-shadow-sm);
}
.sensor-card.warning { border-left: 4px solid var(--hk-accent); }
.sensor-card.critical { border-left: 4px solid var(--hk-danger); }
.sensor-card .sensor-ic {
    width: 40px; height: 40px;
    border-radius: var(--hk-radius-sm);
    background: var(--hk-info-light);
    color: var(--hk-primary);
    display: inline-flex; align-items: center; justify-content: center;
    font-size: 18px;
    flex-shrink: 0;
}
.sensor-card.warning .sensor-ic { background: var(--hk-accent-light); color: var(--hk-accent); }
.sensor-card.critical .sensor-ic { background: #FBE3E6; color: var(--hk-danger); }
.sensor-card .sensor-info { flex: 1; line-height: 1.3; }
.sensor-card .sensor-info strong { font-family: var(--hk-font-mono); font-size: 18px; color: var(--hk-text); }
.sensor-card .sensor-info span { color: var(--hk-text-muted); font-size: 11px; }

/* Twin scene card (hub) */
.scene-card {
    background: var(--hk-surface);
    border: 1px solid var(--hk-border);
    border-radius: var(--hk-radius);
    overflow: hidden;
    transition: all var(--hk-transition);
    cursor: pointer;
    text-decoration: none;
    color: inherit;
    display: block;
}
.scene-card:hover {
    box-shadow: var(--hk-shadow-lg);
    transform: translateY(-4px);
    border-color: var(--hk-primary);
    color: inherit;
}
.scene-card-preview {
    height: 200px;
    background: linear-gradient(135deg, #87CEEB 0%, #B8DCEC 50%, #E8F2F8 100%);
    position: relative;
    overflow: hidden;
}
.scene-card-preview.field {
    background: linear-gradient(180deg, #87CEEB 0%, #B8DCEC 30%, #D4A017 30%, #C8B07F 100%);
}
.scene-card-preview svg { width: 100%; height: 100%; }
.scene-card-body { padding: 18px; }
.scene-card-body h4 { margin: 0 0 4px; font-size: 16px; }
.scene-card-body .scene-meta { color: var(--hk-text-muted); font-size: 12px; }
.scene-card .scene-tags {
    display: flex; gap: 6px; flex-wrap: wrap;
    margin-top: 12px;
}

/* Tooltip on canvas */
.twin-tooltip {
    position: absolute;
    background: rgba(15,38,71,.95);
    color: #fff;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 12px;
    pointer-events: none;
    transform: translate(-50%, -100%);
    margin-top: -8px;
    white-space: nowrap;
    box-shadow: 0 4px 12px rgba(0,0,0,.3);
    z-index: 6;
    display: none;
}
.twin-tooltip::after {
    content: '';
    position: absolute;
    bottom: -5px; left: 50%; transform: translateX(-50%);
    border: 5px solid transparent;
    border-top-color: rgba(15,38,71,.95);
}

/* OYAK + Hektaş badge */
.oyak-corner {
    display: inline-flex; align-items: center; gap: 10px;
    padding: 6px 12px 6px 6px;
    background: var(--hk-surface);
    border-radius: 22px;
    border: 1px solid var(--hk-border);
    box-shadow: var(--hk-shadow-xs);
    font-size: 11px; color: var(--hk-text-muted);
}
.oyak-corner .oyak-dot {
    width: 26px; height: 26px;
    background: var(--hk-oyak-red);
    color: #fff;
    border-radius: 50%;
    display: inline-flex; align-items: center; justify-content: center;
    font-weight: 800; font-size: 11px;
    letter-spacing: -.02em;
}
.oyak-corner strong { color: var(--hk-text); font-weight: 700; }
