﻿/* ===================== VARIABLES & BASE ===================== */
:root {
    --sidebar-bg: #1e293b;
    --sidebar-hover: #334155;
    --sidebar-active: #3b82f6;
    --sidebar-width: 240px;
    --navbar-height: 54px;
    --primary: #3b82f6;
    --primary-dark: #2563eb;
    --success: #10b981;
    --danger: #ef4444;
    --warning: #f59e0b;
    --info: #06b6d4;
    --purple: #8b5cf6;
    --content-bg: #f1f5f9;
    --card-bg: #ffffff;
    --border-color: #e2e8f0;
    --text-primary: #1e293b;
    --text-muted: #64748b;
    --toolbar-bg: #f8fafc;
    --input-height: 28px;
    --font-size-sm: 12px;
    --font-size-base: 13px;
}

* { box-sizing: border-box; }

body {
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    font-size: var(--font-size-base);
    color: var(--text-primary);
    background: var(--content-bg);
    margin: 0;
    padding: 0;
    overflow-x: hidden;
}

a { text-decoration: none; }

/* ===================== LOGIN PAGE ===================== */
.login-page {
    min-height: 100vh;
    background: linear-gradient(135deg, #0f172a 0%, #1e3a5f 50%, #1e293b 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

.login-page::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(ellipse at center, rgba(59,130,246,0.08) 0%, transparent 60%);
    pointer-events: none;
}

.login-card {
    background: #fff;
    border-radius: 16px;
    padding: 44px 40px;
    width: 400px;
    box-shadow: 0 24px 64px rgba(0,0,0,0.35);
    position: relative;
    z-index: 1;
}

.login-logo {
    text-align: center;
    margin-bottom: 32px;
}

.login-logo .brand-icon {
    width: 64px;
    height: 64px;
    background: linear-gradient(135deg, #3b82f6, #2563eb);
    border-radius: 18px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 28px;
    margin-bottom: 14px;
    box-shadow: 0 8px 24px rgba(59,130,246,0.35);
}

.login-logo h4 {
    font-weight: 800;
    color: var(--text-primary);
    margin: 0 0 4px;
    font-size: 20px;
    letter-spacing: -0.3px;
}

.login-logo span {
    color: var(--text-muted);
    font-size: 12px;
    font-weight: 500;
    letter-spacing: 0.3px;
}

.login-card .form-label {
    font-size: 12px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 6px;
    display: block;
}

.login-card .form-control {
    height: 44px;
    border-radius: 10px;
    border: 1.5px solid var(--border-color);
    font-size: 14px;
    padding-left: 14px;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.login-card .form-control:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(59,130,246,0.12);
}

.login-card .input-group .form-control { border-radius: 10px 0 0 10px; }
.login-card .input-group .input-group-text {
    border-radius: 0 10px 10px 0;
    border: 1.5px solid var(--border-color);
    border-left: none;
    background: #f8fafc;
    cursor: pointer;
    color: var(--text-muted);
}

.btn-login {
    height: 46px;
    background: linear-gradient(135deg, #3b82f6, #2563eb);
    border: none;
    border-radius: 10px;
    color: #fff;
    font-weight: 700;
    font-size: 14px;
    width: 100%;
    transition: opacity 0.2s, transform 0.1s;
    box-shadow: 0 4px 14px rgba(59,130,246,0.3);
}

.btn-login:hover { opacity: 0.92; transform: translateY(-1px); }
.btn-login:active { transform: translateY(0); }

.login-footer {
    text-align: center;
    margin-top: 28px;
    font-size: 11px;
    color: var(--text-muted);
}

/* ===================== LAYOUT WRAPPER ===================== */
.wrapper {
    display: flex;
    min-height: 100vh;
}

/* ===================== SIDEBAR ===================== */
.sidebar {
    width: var(--sidebar-width);
    background: var(--sidebar-bg);
    min-height: 100vh;
    position: fixed;
    left: 0;
    top: 0;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    transition: width 0.25s ease;
    overflow-y: auto;
    overflow-x: hidden;
    scrollbar-width: thin;
    scrollbar-color: rgba(255,255,255,0.1) transparent;
}

.sidebar::-webkit-scrollbar { width: 4px; }
.sidebar::-webkit-scrollbar-track { background: transparent; }
.sidebar::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 4px; }

.sidebar-brand {
    padding: 0 16px;
    border-bottom: 1px solid rgba(255,255,255,0.07);
    display: flex;
    align-items: center;
    gap: 10px;
    color: #fff;
    min-height: var(--navbar-height);
    flex-shrink: 0;
}

.sidebar-brand .brand-icon {
    width: 34px;
    height: 34px;
    background: linear-gradient(135deg, #3b82f6, #2563eb);
    border-radius: 9px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    flex-shrink: 0;
}

.sidebar-brand .brand-text {
    font-weight: 800;
    font-size: 14px;
    white-space: nowrap;
    letter-spacing: -0.3px;
}

.sidebar-brand .brand-text small {
    display: block;
    font-size: 9px;
    font-weight: 500;
    color: rgba(255,255,255,0.4);
    letter-spacing: 1px;
    text-transform: uppercase;
    margin-top: 1px;
}

.sidebar-section {
    padding: 16px 0 4px;
}

.sidebar-section-title {
    font-size: 9px;
    font-weight: 800;
    letter-spacing: 1.2px;
    text-transform: uppercase;
    color: rgba(255,255,255,0.28);
    padding: 0 18px 6px;
}

.sidebar-nav { padding-bottom: 20px; }

.sidebar-nav .nav-link {
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 8px 18px;
    color: rgba(255,255,255,0.62);
    font-size: 12.5px;
    font-weight: 500;
    border-left: 3px solid transparent;
    transition: all 0.15s;
    white-space: nowrap;
    cursor: pointer;
    user-select: none;
}

.sidebar-nav .nav-link:hover {
    background: rgba(255,255,255,0.06);
    color: rgba(255,255,255,0.9);
}

.sidebar-nav .nav-link.active {
    background: rgba(59,130,246,0.14);
    color: #fff;
    border-left-color: var(--primary);
}

.sidebar-nav .nav-link i {
    width: 17px;
    font-size: 14px;
    flex-shrink: 0;
    text-align: center;
}

.sidebar-nav .nav-link .nav-badge {
    margin-left: auto;
    font-size: 9px;
    padding: 2px 6px;
    border-radius: 10px;
    background: rgba(59,130,246,0.3);
    color: #93c5fd;
    font-weight: 700;
}

.nav-arrow {
    margin-left: auto;
    font-size: 10px;
    transition: transform 0.2s;
    color: rgba(255,255,255,0.3);
}

.nav-link[aria-expanded="true"] .nav-arrow { transform: rotate(90deg); }

.sidebar-submenu {
    background: rgba(0,0,0,0.18);
    display: none;
}
.sidebar-submenu.show { display: block; }

.sidebar-submenu .nav-link {
    padding-left: 44px;
    font-size: 12px;
    padding-top: 7px;
    padding-bottom: 7px;
    border-left: none;
    color: rgba(255,255,255,0.5);
}

.sidebar-submenu .nav-link::before {
    content: '';
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: rgba(255,255,255,0.25);
    flex-shrink: 0;
    margin-left: -14px;
    margin-right: 9px;
}

.sidebar-submenu .nav-link:hover { color: rgba(255,255,255,0.85); }
.sidebar-submenu .nav-link.active { color: #93c5fd; background: rgba(59,130,246,0.1); }

/* ===================== MAIN CONTENT ===================== */
.main-content {
    margin-left: var(--sidebar-width);
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
    transition: margin-left 0.25s ease;
}

/* ===================== TOP NAVBAR ===================== */
.top-navbar {
    height: var(--navbar-height);
    background: #fff;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    padding: 0 20px;
    gap: 10px;
    position: sticky;
    top: 0;
    z-index: 900;
    box-shadow: 0 1px 4px rgba(0,0,0,0.05);
}

.navbar-toggle {
    width: 32px;
    height: 32px;
    border: none;
    background: none;
    border-radius: 7px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--text-muted);
    font-size: 17px;
    transition: all 0.15s;
}
.navbar-toggle:hover { background: var(--content-bg); color: var(--text-primary); }

.navbar-breadcrumb {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: var(--text-muted);
}
.navbar-breadcrumb a { color: var(--text-muted); }
.navbar-breadcrumb a:hover { color: var(--primary); }
.navbar-breadcrumb .separator { color: #cbd5e1; font-size: 10px; }
.navbar-breadcrumb .current { color: var(--text-primary); font-weight: 700; font-size: 13px; }

.navbar-actions {
    display: flex;
    align-items: center;
    gap: 6px;
}

.navbar-icon-btn {
    width: 34px;
    height: 34px;
    border: none;
    background: none;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--text-muted);
    font-size: 16px;
    position: relative;
    transition: all 0.15s;
}
.navbar-icon-btn:hover { background: var(--content-bg); color: var(--text-primary); }

.notif-badge {
    position: absolute;
    top: 5px;
    right: 5px;
    width: 8px;
    height: 8px;
    background: var(--danger);
    border-radius: 50%;
    border: 2px solid #fff;
}

.navbar-divider {
    width: 1px;
    height: 22px;
    background: var(--border-color);
    margin: 0 2px;
}

.user-dropdown-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 4px 8px 4px 4px;
    border: none;
    background: none;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.15s;
}
.user-dropdown-btn:hover { background: var(--content-bg); }

.user-avatar {
    width: 32px;
    height: 32px;
    background: linear-gradient(135deg, #3b82f6, #7c3aed);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-weight: 700;
    font-size: 12px;
    flex-shrink: 0;
}

.user-info .user-name {
    font-size: 12px;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.2;
    display: block;
}
.user-info .user-role {
    font-size: 10px;
    color: var(--text-muted);
    line-height: 1.2;
    display: block;
}

/* ===================== CONTENT AREA ===================== */
.content-area {
    padding: 18px 20px;
    flex: 1;
}

/* ===================== PAGE HEADER ===================== */
.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}
.page-header h5 {
    font-size: 15px;
    font-weight: 800;
    margin: 0;
    color: var(--text-primary);
    letter-spacing: -0.3px;
}
.page-header .page-header-actions {
    display: flex;
    gap: 8px;
    align-items: center;
}

/* ===================== STAT CARDS ===================== */
.stat-card {
    background: #fff;
    border-radius: 12px;
    padding: 18px 20px;
    border: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    gap: 14px;
    transition: box-shadow 0.2s, transform 0.2s;
    cursor: default;
}
.stat-card:hover {
    box-shadow: 0 6px 20px rgba(0,0,0,0.08);
    transform: translateY(-2px);
}

.stat-icon {
    width: 50px;
    height: 50px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    flex-shrink: 0;
}
.stat-icon.blue   { background: rgba(59,130,246,0.1);  color: #3b82f6; }
.stat-icon.green  { background: rgba(16,185,129,0.1);  color: #10b981; }
.stat-icon.orange { background: rgba(245,158,11,0.1);  color: #f59e0b; }
.stat-icon.red    { background: rgba(239,68,68,0.1);   color: #ef4444; }
.stat-icon.purple { background: rgba(139,92,246,0.1);  color: #8b5cf6; }
.stat-icon.cyan   { background: rgba(6,182,212,0.1);   color: #06b6d4; }

.stat-content .stat-value {
    font-size: 24px;
    font-weight: 800;
    color: var(--text-primary);
    line-height: 1;
    margin-bottom: 4px;
    letter-spacing: -0.5px;
}
.stat-content .stat-label {
    font-size: 12px;
    color: var(--text-muted);
    font-weight: 500;
    margin-bottom: 4px;
}
.stat-content .stat-change {
    font-size: 11px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 3px;
}
.stat-change.up   { color: var(--success); }
.stat-change.down { color: var(--danger); }

/* ===================== PANEL ===================== */
.panel {
    background: #fff;
    border-radius: 12px;
    border: 1px solid var(--border-color);
    margin-bottom: 16px;
    overflow: hidden;
}

.panel-header {
    padding: 11px 16px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: #fafbfc;
}
.panel-header h6 {
    font-size: 13px;
    font-weight: 700;
    margin: 0;
    color: var(--text-primary);
}
.panel-body { padding: 16px; }

/* ===================== ACTION TOOLBAR ===================== */
.action-toolbar {
    background: var(--toolbar-bg);
    border: 1px solid var(--border-color);
    border-radius: 10px 10px 0 0;
    padding: 7px 12px;
    display: flex;
    align-items: center;
    gap: 3px;
    flex-wrap: wrap;
}

.toolbar-sep {
    width: 1px;
    height: 22px;
    background: var(--border-color);
    margin: 0 5px;
}

.btn-tb {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 5px 11px;
    border: 1px solid var(--border-color);
    background: #fff;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-primary);
    cursor: pointer;
    transition: all 0.15s;
    white-space: nowrap;
    line-height: 1;
}
.btn-tb:hover { background: var(--content-bg); border-color: #cbd5e1; }
.btn-tb i { font-size: 13px; }

.btn-tb.primary { background: var(--primary); color: #fff; border-color: var(--primary); }
.btn-tb.primary:hover { background: var(--primary-dark); }
.btn-tb.danger  { background: var(--danger);  color: #fff; border-color: var(--danger); }
.btn-tb.danger:hover  { background: #dc2626; }
.btn-tb.success { background: var(--success); color: #fff; border-color: var(--success); }
.btn-tb.success:hover { background: #059669; }
.btn-tb.warning { background: var(--warning); color: #fff; border-color: var(--warning); }
.btn-tb.info    { background: var(--info);    color: #fff; border-color: var(--info); }

/* ===================== FORM PANEL (below toolbar) ===================== */
.form-panel {
    background: #fff;
    border: 1px solid var(--border-color);
    border-top: none;
    padding: 10px 14px 8px;
}

/* ===================== COMPACT FORM ===================== */
.compact-form .row { margin-bottom: 5px; }

.compact-form .form-label {
    font-size: 11px;
    font-weight: 700;
    color: var(--text-muted);
    margin-bottom: 3px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: block;
    text-transform: uppercase;
    letter-spacing: 0.2px;
}

.compact-form .form-control,
.compact-form .form-select {
    height: var(--input-height);
    font-size: var(--font-size-sm);
    padding: 2px 8px;
    border-color: #d1d5db;
    border-radius: 5px;
    color: var(--text-primary);
}

.compact-form .form-control:focus,
.compact-form .form-select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 2px rgba(59,130,246,0.14);
}

.compact-form .input-group .form-control { border-radius: 5px 0 0 5px; }
.compact-form .input-group .form-control:not(:last-child) { border-right: none; }

.compact-form .input-group-text {
    height: var(--input-height);
    padding: 0 7px;
    font-size: 11px;
    background: #f8fafc;
    border-color: #d1d5db;
    cursor: pointer;
    color: var(--text-muted);
    border-radius: 0;
}
.compact-form .input-group-text:last-child { border-radius: 0 5px 5px 0; }
.compact-form .input-group-text:hover { background: #e2e8f0; color: var(--text-primary); }

.compact-form .form-check {
    display: flex;
    align-items: center;
    gap: 5px;
    padding-top: 6px;
}
.compact-form .form-check-input {
    width: 15px;
    height: 15px;
    cursor: pointer;
    margin: 0;
    flex-shrink: 0;
}
.compact-form .form-check-label {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-muted);
    cursor: pointer;
    white-space: nowrap;
}

.compact-form .form-divider {
    border: none;
    border-top: 1px dashed var(--border-color);
    margin: 8px 0 6px;
}

/* ===================== FORM TABS ===================== */
.form-tabs-bar {
    border-bottom: 1px solid var(--border-color);
    display: flex;
    gap: 0;
    margin: 8px -14px 0;
    padding: 0 14px;
}

.form-tab-btn {
    padding: 7px 16px;
    font-size: 12px;
    font-weight: 700;
    color: var(--text-muted);
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    cursor: pointer;
    transition: all 0.15s;
    margin-bottom: -1px;
}
.form-tab-btn:hover { color: var(--text-primary); }
.form-tab-btn.active { color: var(--primary); border-bottom-color: var(--primary); }

.form-tab-pane { display: none; padding-top: 10px; }
.form-tab-pane.active { display: block; }

/* ===================== DETAIL GRID ===================== */
.detail-section {
    border: 1px solid var(--border-color);
    border-top: none;
    border-radius: 0 0 10px 10px;
    overflow: hidden;
}

.detail-grid-toolbar {
    background: #f1f5f9;
    border-bottom: 1px solid var(--border-color);
    padding: 6px 12px;
    display: flex;
    align-items: center;
    gap: 8px;
}
.detail-grid-toolbar .grid-title {
    font-size: 11px;
    font-weight: 800;
    color: var(--text-primary);
    flex: 1;
    text-transform: uppercase;
    letter-spacing: 0.4px;
}

.detail-table-wrap {
    overflow-x: auto;
    max-height: 250px;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: #cbd5e1 #f8fafc;
}
.detail-table-wrap::-webkit-scrollbar { height: 6px; width: 6px; }
.detail-table-wrap::-webkit-scrollbar-track { background: #f8fafc; }
.detail-table-wrap::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 4px; }

.detail-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 11px;
    min-width: 1000px;
}

.detail-table thead th {
    background: #f8fafc;
    padding: 6px 8px;
    font-size: 10px;
    font-weight: 800;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.4px;
    border-bottom: 1px solid var(--border-color);
    white-space: nowrap;
    position: sticky;
    top: 0;
    z-index: 2;
}

.detail-table tbody td {
    padding: 2px 3px;
    border-bottom: 1px solid #f1f5f9;
    vertical-align: middle;
}

.detail-table tbody tr:hover td { background: rgba(59,130,246,0.04); }

.cell-num {
    width: 30px;
    text-align: center;
    color: #94a3b8;
    font-size: 10px;
    font-weight: 700;
}

.cell-input {
    width: 100%;
    height: 23px;
    border: 1px solid transparent;
    background: transparent;
    padding: 1px 5px;
    font-size: 11px;
    border-radius: 4px;
    color: var(--text-primary);
    font-family: inherit;
}
.cell-input:focus {
    border-color: var(--primary);
    background: #fff;
    outline: none;
    box-shadow: 0 0 0 2px rgba(59,130,246,0.12);
}
.cell-input.right { text-align: right; }

.cell-select {
    width: 100%;
    height: 23px;
    border: 1px solid transparent;
    background: transparent;
    padding: 1px 4px;
    font-size: 11px;
    border-radius: 4px;
    color: var(--text-primary);
    cursor: pointer;
    font-family: inherit;
}
.cell-select:focus {
    border-color: var(--primary);
    background: #fff;
    outline: none;
}

.cell-check {
    display: block;
    width: 14px;
    height: 14px;
    margin: 0 auto;
    cursor: pointer;
}

.btn-row-del {
    width: 22px;
    height: 22px;
    background: none;
    border: none;
    color: #ef4444;
    cursor: pointer;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    margin: 0 auto;
    transition: background 0.15s;
}
.btn-row-del:hover { background: rgba(239,68,68,0.1); }

/* ===================== SUMMARY BAR ===================== */
.summary-bar {
    background: var(--sidebar-bg);
    display: flex;
    align-items: stretch;
    border-radius: 0 0 10px 10px;
    overflow: hidden;
}

.summary-item {
    flex: 1;
    padding: 9px 16px;
    text-align: right;
    border-right: 1px solid rgba(255,255,255,0.08);
}
.summary-item:last-child { border-right: none; }

.summary-item .sum-label {
    font-size: 9px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: rgba(255,255,255,0.45);
    display: block;
    margin-bottom: 3px;
}
.summary-item .sum-value {
    font-size: 17px;
    font-weight: 800;
    color: #fff;
    font-variant-numeric: tabular-nums;
    letter-spacing: -0.3px;
}
.summary-item.accent .sum-value { color: #60a5fa; }
.summary-item.accent-green .sum-value { color: #34d399; }

/* ===================== DATATABLES PANEL ===================== */
.dt-panel {
    background: #fff;
    border-radius: 12px;
    border: 1px solid var(--border-color);
    overflow: hidden;
}

.dt-panel-toolbar {
    padding: 12px 16px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    background: #fafbfc;
}
.dt-panel-toolbar h6 {
    font-size: 13px;
    font-weight: 800;
    margin: 0;
    flex: 1;
    color: var(--text-primary);
}

table.dataTable thead th {
    font-size: 10px !important;
    font-weight: 800 !important;
    text-transform: uppercase !important;
    letter-spacing: 0.4px !important;
    color: var(--text-muted) !important;
    background: #f8fafc !important;
    border-bottom: 1px solid var(--border-color) !important;
    padding: 10px 12px !important;
    white-space: nowrap !important;
}

table.dataTable tbody td {
    font-size: 12px !important;
    padding: 8px 12px !important;
    color: var(--text-primary) !important;
    vertical-align: middle !important;
    border-bottom: 1px solid #f8fafc !important;
}

table.dataTable tbody tr:hover td { background: rgba(59,130,246,0.04) !important; }

.dataTables_wrapper .dataTables_paginate .paginate_button {
    font-size: 12px !important;
    border-radius: 6px !important;
    padding: 4px 10px !important;
}

.dataTables_wrapper .dataTables_length select,
.dataTables_wrapper .dataTables_filter input {
    font-size: 12px !important;
    border-radius: 6px !important;
    border: 1px solid var(--border-color) !important;
    padding: 4px 8px !important;
    height: 32px !important;
}

.dataTables_wrapper .dataTables_info { font-size: 11px !important; color: var(--text-muted) !important; }

/* ===================== STATUS BADGES ===================== */
.status-badge {
    padding: 3px 9px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 700;
    white-space: nowrap;
}
.status-aktif      { background: rgba(16,185,129,0.1); color: #059669; }
.status-beklemede  { background: rgba(245,158,11,0.1);  color: #d97706; }
.status-iptal      { background: rgba(239,68,68,0.1);   color: #dc2626; }
.status-tamamlandi { background: rgba(59,130,246,0.1);  color: #2563eb; }
.status-devam      { background: rgba(139,92,246,0.1);  color: #7c3aed; }

/* ===================== FOOTER ===================== */
.content-footer {
    padding: 11px 20px;
    border-top: 1px solid var(--border-color);
    background: #fff;
    font-size: 11px;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

/* ===================== UTILITIES ===================== */
.gap-2 { gap: 8px; }
.fs-11 { font-size: 11px; }
.fs-12 { font-size: 12px; }
.fw-700 { font-weight: 700; }
.color-muted { color: var(--text-muted); }

.quick-search {
    height: 32px;
    font-size: 12px;
    border-radius: 7px;
    border: 1px solid var(--border-color);
    padding: 0 10px 0 30px;
    background: #f8fafc url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='13' height='13' fill='%2394a3b8' viewBox='0 0 16 16'%3E%3Cpath d='M11.742 10.344a6.5 6.5 0 1 0-1.397 1.398h-.001q.044.06.098.115l3.85 3.85a1 1 0 0 0 1.415-1.414l-3.85-3.85a1 1 0 0 0-.115-.1zM12 6.5a5.5 5.5 0 1 1-11 0 5.5 5.5 0 0 1 11 0'/%3E%3C/svg%3E") no-repeat 9px center;
    transition: border-color 0.15s;
    outline: none;
}
.quick-search:focus { border-color: var(--primary); background-color: #fff; }

.btn-sm-action {
    height: 30px;
    padding: 0 12px;
    font-size: 12px;
    font-weight: 600;
    border-radius: 6px;
    border: 1px solid var(--border-color);
    background: #fff;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    color: var(--text-primary);
    transition: all 0.15s;
}
.btn-sm-action:hover { background: var(--content-bg); }
.btn-sm-action.primary { background: var(--primary); color: #fff; border-color: var(--primary); }
.btn-sm-action.primary:hover { background: var(--primary-dark); }
.btn-sm-action.danger { background: var(--danger); color: #fff; border-color: var(--danger); }

/* ===================== RECENT ACTIVITY TABLE ===================== */
.activity-table td { vertical-align: middle; }
.activity-table .activity-icon {
    width: 30px;
    height: 30px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
}

/* ===================== HORIZONTAL FORM (Windows Form Stili) ===================== */
.hf-panel {
    background: #fff;
    border: 1px solid var(--border-color);
    border-top: none;
    overflow: hidden;
}

.hf-row {
    display: flex;
    align-items: stretch;
    border-bottom: 1px solid var(--border-color);
    min-height: 30px;
}
.hf-row:last-child { border-bottom: none; }

.hf-cell {
    display: flex;
    align-items: center;
    border-right: 1px solid var(--border-color);
    flex-shrink: 0;
    overflow: hidden;
}
.hf-cell:last-child { border-right: none; }
.hf-cell.grow { flex: 1; flex-shrink: 1; min-width: 0; }

.hf-lbl {
    font-size: 10.5px;
    font-weight: 700;
    color: #475569;
    white-space: nowrap;
    background: #f1f5f9;
    padding: 0 8px;
    border-right: 1px solid var(--border-color);
    align-self: stretch;
    display: flex;
    align-items: center;
    flex-shrink: 0;
    text-transform: uppercase;
    letter-spacing: 0.2px;
    user-select: none;
}

.hf-inp {
    flex: 1;
    padding: 2px 4px;
    display: flex;
    align-items: center;
    gap: 1px;
    min-width: 0;
}

.hf-inp input[type="text"],
.hf-inp input[type="date"],
.hf-inp input[type="time"],
.hf-inp input[type="number"],
.hf-inp select,
.hf-inp textarea {
    height: 26px;
    font-size: 12px;
    padding: 2px 6px;
    border: 1px solid #d1d5db;
    border-radius: 3px;
    color: var(--text-primary);
    font-family: inherit;
    background: #fff;
    outline: none;
    box-sizing: border-box;
}
.hf-inp input:focus,
.hf-inp select:focus,
.hf-inp textarea:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 2px rgba(59,130,246,0.1);
    z-index: 1;
    position: relative;
}

/* Tam genişlik input (flex:1) */
.hf-inp .fw { flex: 1; min-width: 0; width: 100%; }

/* Sabit genişlik inputlar */
.hf-inp .w-date  { width: 128px; flex: none; }
.hf-inp .w-time  { width: 80px;  flex: none; margin-left: 3px; }
.hf-inp .w-num   { width: 65px;  flex: none; text-align: right; }
.hf-inp .w-kur   { width: 82px;  flex: none; text-align: right; margin-left: 2px; border-radius: 3px !important; }
.hf-inp .w-doviz { width: 66px;  flex: none; }

/* Özel durumlar */
.hf-inp .is-auto { background: #f0fdf4 !important; color: #059669 !important; font-weight: 700 !important; }
.hf-inp .right   { text-align: right; }

/* Input'un sağında icon butonu varsa sağ köşe yok */
.hf-inp .has-btn { border-radius: 3px 0 0 3px !important; border-right: none !important; }

/* Icon butonlar (🔍 / +) */
.hf-icon {
    width: 24px;
    height: 26px;
    border: 1px solid #d1d5db;
    border-left: none;
    background: #f8fafc;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    color: #64748b;
    flex-shrink: 0;
    border-radius: 0;
    transition: background 0.12s;
    padding: 0;
}
.hf-icon:last-of-type { border-radius: 0 3px 3px 0; }
.hf-icon:hover { background: #e2e8f0; color: var(--text-primary); }
.hf-icon.add { color: var(--primary); }
.hf-icon.add:hover { background: rgba(59,130,246,0.08); }

/* Checkbox grubu (satır sonunda) */
.hf-checks {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 0 12px;
    flex-shrink: 0;
}
.hf-chk {
    display: flex;
    align-items: center;
    gap: 4px;
    cursor: pointer;
    user-select: none;
}
.hf-chk input[type="checkbox"] {
    width: 14px;
    height: 14px;
    cursor: pointer;
    flex-shrink: 0;
    margin: 0;
}
.hf-chk label {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-muted);
    cursor: pointer;
    margin: 0;
    white-space: nowrap;
}

/* Tab bar HF stili */
.hf-tabs {
    display: flex;
    border-bottom: 1px solid var(--border-color);
    background: #f8fafc;
    padding: 0 8px;
}
.hf-tab-btn {
    padding: 6px 16px;
    font-size: 12px;
    font-weight: 700;
    color: var(--text-muted);
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    cursor: pointer;
    transition: all 0.15s;
    margin-bottom: -1px;
}
.hf-tab-btn:hover { color: var(--text-primary); }
.hf-tab-btn.active { color: var(--primary); border-bottom-color: var(--primary); }

.hf-tab-pane { display: none; }
.hf-tab-pane.active { display: block; }

/* ================================================================
   CSS GRID SATIRLARI — hf-gr4 / hf-gr3c
   Her label tam 108px, input esnek → tüm satırlarda hizalama tam.
   2 grup: sol 2 hücre / sağ 2 hücre — aralarında 2px seperatör.
   ================================================================ */

/* 4 hücreli satır: [lbl 108px][inp 1fr]×4 */
.hf-row.hf-gr4 {
    display: grid;
    grid-template-columns: 108px 1fr 108px 1fr 108px 1fr 108px 1fr;
}
/* 3 hücreli satır (Cari Hesap): [lbl][inp geniş][lbl][inp][lbl][inp] */
.hf-row.hf-gr3c {
    display: grid;
    grid-template-columns: 108px 2fr 108px 1fr 108px 1fr;
}

/* Grid içinde .hf-lbl — genişliği grid tarafından kontrol edilir */
.hf-row.hf-gr4 > .hf-lbl,
.hf-row.hf-gr3c > .hf-lbl {
    min-width: unset;
    font-size: 10px;
    letter-spacing: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    padding: 0 5px 0 7px;
}

/* Grid içinde .hf-inp — inputun sağı ile sonraki label arası border */
.hf-row.hf-gr4 > .hf-inp,
.hf-row.hf-gr3c > .hf-inp {
    display: flex;
    align-items: center;
    gap: 1px;
    padding: 2px 3px;
    border-right: 1px solid var(--border-color);
    min-width: 0;
}

/* Grup ayırıcı: gr4'te 4. eleman (2. inp) sağa 2px border — sol grup biter */
.hf-row.hf-gr4 > :nth-child(4) {
    border-right: 2px solid #94a3b8 !important;
}

/* Son eleman: sağ border yok */
.hf-row.hf-gr4 > :last-child,
.hf-row.hf-gr3c > :last-child {
    border-right: none !important;
}

/* Grid inp içindeki inputlar tam genişlik kaplar */
.hf-row.hf-gr4 .hf-inp input,
.hf-row.hf-gr4 .hf-inp select,
.hf-row.hf-gr3c .hf-inp input,
.hf-row.hf-gr3c .hf-inp select {
    flex: 1;
    width: 100%;
    min-width: 0;
}

/* Number input: sağa hizalı */
.hf-row.hf-gr4 .hf-inp input[type="number"],
.hf-row.hf-gr3c .hf-inp input[type="number"] {
    text-align: right;
}
