/* ============================================================
   IKPlus Hub — Light SaaS Theme (MindFlow Style)
   White sidebar, White background, Orange accents
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');

:root {
    --brand-50: #fff7ed;
    --brand-100: #ffedd5;
    --brand-200: #fed7aa;
    --brand-300: #fdba74;
    --brand-400: #fb923c;
    --brand-500: #f97316;
    --brand-600: #ea580c;
    --brand-700: #c2410c;

    --white: #ffffff;
    --gray-25: #fcfcfd;
    --gray-50: #f9fafb;
    --gray-100: #f3f4f6;
    --gray-200: #e5e7eb;
    --gray-300: #d1d5db;
    --gray-400: #9ca3af;
    --gray-500: #6b7280;
    --gray-600: #4b5563;
    --gray-700: #374151;
    --gray-800: #1f2937;
    --gray-900: #111827;

    --green-500: #22c55e;
    --green-100: #dcfce7;
    --red-500: #ef4444;
    --red-100: #fee2e2;
    --blue-500: #3b82f6;
    --blue-100: #dbeafe;
    --amber-500: #f59e0b;
    --amber-100: #fef3c7;
    --purple-500: #8b5cf6;
    --purple-100: #ede9fe;
    --teal-500: #14b8a6;

    --sidebar-width: 230px;
    --sidebar-collapsed: 0px;
}

*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 14px;
    height: 100%;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: var(--gray-50);
    color: var(--gray-800);
    line-height: 1.5;
    height: 100%;
    overflow: hidden;
}

.app-layout {
    display: flex;
    height: 100vh;
    overflow: hidden;
}

a {
    color: var(--brand-600);
    text-decoration: none;
}

a:hover {
    color: var(--brand-700);
}

/* ============================================================
   LOGIN — Split Layout
   ============================================================ */
.login-page {
    display: flex;
    min-height: 100vh;
}

.login-left {
    width: 44%;
    background: linear-gradient(160deg, #1e293b 0%, #334155 100%);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 3rem;
    position: relative;
    overflow: hidden;
}

.login-left::before {
    content: '';
    position: absolute;
    width: 350px;
    height: 350px;
    background: rgba(249, 115, 22, 0.06);
    border-radius: 50%;
    bottom: -100px;
    left: -60px;
}

.login-brand {
    text-align: center;
    position: relative;
    z-index: 1;
}

.login-brand .logo-icon {
    width: 72px;
    height: 72px;
    background: linear-gradient(135deg, var(--brand-500), var(--brand-600));
    border-radius: 18px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8rem;
    color: #fff;
    margin-bottom: 1rem;
    box-shadow: 0 6px 24px rgba(249, 115, 22, 0.25);
}

.login-brand h1 {
    color: #fff;
    font-size: 1.6rem;
    font-weight: 700;
}

.login-brand .brand-sub {
    color: var(--brand-400);
    font-size: 0.8rem;
    font-weight: 500;
    letter-spacing: 0.04em;
}

.login-brand .tagline {
    color: #e2e8f0;
    font-size: 1.1rem;
    font-weight: 600;
    margin-top: 1.5rem;
    line-height: 1.4;
}

.login-brand .tagline-sub {
    color: var(--gray-400);
    font-size: 0.75rem;
    margin-top: 0.4rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.login-features {
    margin-top: 1.5rem;
    list-style: none;
    position: relative;
    z-index: 1;
}

.login-features li {
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.82rem;
    padding: 0.4rem 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.login-features li i {
    color: var(--brand-400);
    font-size: 0.55rem;
}

.login-right {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    background: var(--white);
}

.login-form-box {
    width: 100%;
    max-width: 360px;
}

.login-form-box .welcome {
    margin-bottom: 1.5rem;
}

.login-form-box .welcome h2 {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--gray-900);
}

.login-form-box .welcome p {
    color: var(--gray-500);
    font-size: 0.85rem;
    margin-top: 0.2rem;
}

.form-group {
    margin-bottom: 1rem;
}

.form-group label {
    display: block;
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--gray-600);
    margin-bottom: 0.3rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.input-wrapper {
    position: relative;
}

.input-wrapper i {
    position: absolute;
    left: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--gray-400);
    font-size: 0.85rem;
}

.input-wrapper input {
    width: 100%;
    padding: 0.65rem 0.75rem 0.65rem 2.25rem;
    border: 1px solid var(--gray-200);
    border-radius: 8px;
    font-size: 0.88rem;
    font-family: inherit;
    color: var(--gray-800);
    background: var(--white);
    transition: border 0.15s, box-shadow 0.15s;
    outline: none;
}

.input-wrapper input:focus {
    border-color: var(--brand-500);
    box-shadow: 0 0 0 3px rgba(249, 115, 22, 0.08);
}

.input-wrapper input::placeholder {
    color: var(--gray-400);
}

.btn-brand {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    width: 100%;
    padding: 0.7rem;
    background: linear-gradient(135deg, var(--brand-500), var(--brand-600));
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 0.92rem;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.15s;
    box-shadow: 0 2px 8px rgba(249, 115, 22, 0.2);
    margin-top: 0.4rem;
}

.btn-brand:hover {
    background: linear-gradient(135deg, var(--brand-600), var(--brand-700));
    transform: translateY(-1px);
}

.alert-error {
    background: var(--red-100);
    border: 1px solid rgba(239, 68, 68, 0.2);
    border-radius: 8px;
    padding: 0.6rem 0.8rem;
    margin-bottom: 1rem;
    color: var(--red-500);
    font-size: 0.8rem;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.login-footer {
    text-align: center;
    margin-top: 1.5rem;
    color: var(--gray-400);
    font-size: 0.72rem;
}

/* ============================================================
   APP LAYOUT
   ============================================================ */
.app-layout {
    display: flex;
    min-height: 100vh;
}

/* ---- WHITE SIDEBAR ---- */
.sidebar {
    width: var(--sidebar-width);
    background: var(--white);
    border-right: 1px solid var(--gray-200);
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    z-index: 100;
    transition: transform 0.25s ease, width 0.25s ease;
    overflow-y: auto;
    overflow-x: hidden;
}

.sidebar::-webkit-scrollbar {
    width: 3px;
}

.sidebar::-webkit-scrollbar-thumb {
    background: var(--gray-300);
    border-radius: 10px;
}

.sidebar.collapsed {
    transform: translateX(-100%);
}

/* Sidebar Toggle Button */
.sidebar-toggle {
    position: fixed;
    top: 50%;
    left: var(--sidebar-width);
    transform: translateY(-50%);
    width: 20px;
    height: 40px;
    background: var(--white);
    border: 1px solid var(--gray-200);
    border-left: none;
    border-radius: 0 6px 6px 0;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 101;
    color: var(--gray-500);
    font-size: 0.7rem;
    transition: left 0.25s ease, background 0.15s;
    box-shadow: 2px 0 4px rgba(0, 0, 0, 0.04);
}

.sidebar-toggle:hover {
    background: var(--gray-50);
    color: var(--brand-600);
}

.sidebar-toggle.collapsed {
    left: 0;
}

.sidebar-header {
    padding: 0.85rem 1rem;
    display: flex;
    align-items: center;
    gap: 0.6rem;
    border-bottom: 1px solid var(--gray-100);
}

.sidebar-header .logo-box {
    width: 34px;
    height: 34px;
    background: linear-gradient(135deg, var(--brand-500), var(--brand-600));
    border-radius: 9px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    color: #fff;
    font-size: 0.8rem;
    flex-shrink: 0;
}

.sidebar-header h2 {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--gray-900);
    line-height: 1.2;
}

.sidebar-header span {
    font-size: 0.6rem;
    color: var(--brand-500);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* Tenant Selector */
.tenant-select {
    margin: 0.5rem 0.65rem 0;
    padding: 0.4rem 0.55rem;
    background: var(--gray-50);
    border: 1px solid var(--gray-200);
    border-radius: 6px;
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.72rem;
    color: var(--gray-600);
}

.tenant-select i {
    font-size: 0.7rem;
    color: var(--brand-500);
}

.tenant-select select {
    background: transparent;
    border: none;
    color: var(--gray-700);
    font-family: inherit;
    font-size: 0.72rem;
    outline: none;
    cursor: pointer;
    flex: 1;
}

/* Nav */
.sidebar-nav {
    flex: 1;
    padding: 0.4rem 0;
}

.nav-section {
    padding: 0 0.5rem;
    margin-bottom: 0.1rem;
}

.nav-section-title {
    font-size: 0.58rem;
    font-weight: 700;
    color: var(--gray-400);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    padding: 0.5rem 0.55rem 0.2rem;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    padding: 0.4rem 0.55rem;
    border-radius: 6px;
    color: var(--gray-600);
    font-size: 0.8rem;
    font-weight: 500;
    transition: all 0.12s;
    cursor: pointer;
    text-decoration: none;
}

.nav-item:hover {
    background: var(--gray-50);
    color: var(--gray-900);
}

.nav-item.active {
    background: var(--brand-500);
    color: #fff;
}

.nav-item.active:hover {
    background: var(--brand-600);
    color: #fff;
}

.nav-item i {
    width: 17px;
    text-align: center;
    font-size: 0.82rem;
    flex-shrink: 0;
}

.nav-item .badge {
    margin-left: auto;
    background: var(--brand-100);
    color: var(--brand-700);
    font-size: 0.6rem;
    font-weight: 700;
    padding: 0.08rem 0.35rem;
    border-radius: 999px;
}

.nav-item.active .badge {
    background: rgba(255, 255, 255, 0.25);
    color: #fff;
}

/* Sidebar Footer */
.sidebar-footer {
    padding: 0.5rem 0.65rem;
    border-top: 1px solid var(--gray-100);
}

.user-card {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.4rem;
    border-radius: 8px;
}

.user-card:hover {
    background: var(--gray-50);
}

.user-avatar {
    width: 30px;
    height: 30px;
    background: linear-gradient(135deg, var(--brand-400), var(--brand-600));
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    color: #fff;
    font-size: 0.7rem;
    flex-shrink: 0;
}

.user-info .name {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--gray-800);
}

.user-info .role {
    font-size: 0.6rem;
    color: var(--brand-500);
    font-weight: 500;
}

/* ---- MAIN CONTENT ---- */
.main-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    height: 100vh;
    display: flex;
    flex-direction: column;
    background: var(--gray-50);
    transition: margin-left 0.25s ease;
    overflow: hidden;
}

.page-content {
    flex: 1;
    min-height: 0;
    overflow: auto;
    padding: 0.75rem 1rem;
}

.main-content.expanded {
    margin-left: 0;
}

/* Top Bar */
.top-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.5rem 1.25rem;
    background: var(--white);
    border-bottom: 1px solid var(--gray-200);
    position: sticky;
    top: 0;
    z-index: 50;
}

.top-bar .page-info h2 {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--gray-900);
}

.top-bar .page-info p {
    font-size: 0.7rem;
    color: var(--gray-500);
}

.top-bar-right {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.role-badge {
    background: var(--brand-500);
    color: #fff;
    font-size: 0.62rem;
    font-weight: 700;
    padding: 0.2rem 0.55rem;
    border-radius: 5px;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.icon-btn {
    width: 32px;
    height: 32px;
    background: var(--gray-50);
    border: 1px solid var(--gray-200);
    border-radius: 7px;
    color: var(--gray-500);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.12s;
    font-size: 0.82rem;
}

.icon-btn:hover {
    background: var(--brand-50);
    border-color: var(--brand-200);
    color: var(--brand-600);
}

/* Page Content */
.page-content {
    flex: 1;
    padding: 0.75rem 1rem;
}

/* ============================================================
   ACTION BUTTONS — MindFlow Style
   ============================================================ */
.action-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 0.5rem;
    margin-bottom: 0.6rem;
}

.action-btn {
    padding: 0.65rem 0.5rem;
    border-radius: 8px;
    border: none;
    color: #fff;
    font-family: inherit;
    font-size: 0.75rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.1rem;
    transition: all 0.15s;
    text-decoration: none;
    position: relative;
}

.action-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
    color: #fff;
}

.action-btn .btn-num {
    font-size: 1.4rem;
    font-weight: 800;
    line-height: 1;
}

.action-btn .btn-label {
    font-size: 0.68rem;
    font-weight: 500;
    opacity: 0.9;
}

.action-btn .btn-arrow {
    position: absolute;
    bottom: 0.4rem;
    right: 0.5rem;
    font-size: 0.7rem;
    opacity: 0.6;
}

.action-btn.green {
    background: linear-gradient(135deg, #22c55e, #16a34a);
}

.action-btn.red {
    background: linear-gradient(135deg, #ef4444, #dc2626);
}

.action-btn.amber {
    background: linear-gradient(135deg, #f59e0b, #d97706);
}

.action-btn.blue {
    background: linear-gradient(135deg, #3b82f6, #2563eb);
}

.action-btn.purple {
    background: linear-gradient(135deg, #8b5cf6, #7c3aed);
}

.action-btn.orange {
    background: linear-gradient(135deg, var(--brand-500), var(--brand-600));
}

.action-btn.teal {
    background: linear-gradient(135deg, #14b8a6, #0d9488);
}

.action-btn.slate {
    background: linear-gradient(135deg, #64748b, #475569);
}

/* Tools Row */
.tools-row {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.5rem;
    margin-bottom: 0.6rem;
}

.tool-btn {
    padding: 0.5rem 0.65rem;
    background: var(--white);
    border: 1px solid var(--gray-200);
    border-radius: 7px;
    display: flex;
    align-items: center;
    gap: 0.4rem;
    color: var(--gray-700);
    font-size: 0.75rem;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.12s;
    text-decoration: none;
}

.tool-btn:hover {
    border-color: var(--brand-300);
    background: var(--brand-50);
    color: var(--brand-700);
}

.tool-btn i {
    color: var(--brand-500);
    font-size: 0.82rem;
    width: 16px;
    text-align: center;
}

/* ============================================================
   DATA TABLE — Dense Excel-Like
   ============================================================ */
.table-card {
    background: var(--white);
    border: 1px solid var(--gray-200);
    border-radius: 8px;
    overflow: hidden;
}

.table-header {
    padding: 0.5rem 0.75rem;
    border-bottom: 1px solid var(--gray-200);
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--gray-25);
}

.table-header h3 {
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--gray-800);
    display: flex;
    align-items: center;
    gap: 0.35rem;
}

.table-header h3 i {
    color: var(--brand-500);
}

.table-actions {
    display: flex;
    align-items: center;
    gap: 0.35rem;
}

.table-actions input[type="text"] {
    padding: 0.3rem 0.55rem;
    border: 1px solid var(--gray-200);
    border-radius: 5px;
    font-size: 0.72rem;
    font-family: inherit;
    width: 170px;
    outline: none;
}

.table-actions input[type="text"]:focus {
    border-color: var(--brand-400);
}

.btn-sm {
    padding: 0.25rem 0.55rem;
    font-size: 0.7rem;
    font-weight: 600;
    border-radius: 5px;
    border: 1px solid var(--gray-200);
    background: var(--white);
    color: var(--gray-600);
    cursor: pointer;
    font-family: inherit;
    transition: all 0.12s;
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
}

.btn-sm:hover {
    border-color: var(--brand-300);
    color: var(--brand-600);
}

.btn-sm.brand {
    background: var(--brand-500);
    color: #fff;
    border-color: var(--brand-500);
}

.btn-sm.brand:hover {
    background: var(--brand-600);
}

.btn-sm.green {
    background: var(--green-500);
    color: #fff;
    border-color: var(--green-500);
}

.data-table-wrapper {
    overflow-x: auto;
    overflow-y: auto;
}

.data-table {
    min-width: 100%;
    border-collapse: collapse;
    font-size: 0.76rem;
    table-layout: auto;
}

.data-table thead {
    background: var(--gray-50);
    position: sticky;
    top: 0;
    z-index: 5;
}

.data-table thead th {
    padding: 0.3rem 0.3rem;
    font-size: 0.65rem;
    font-weight: 700;
    color: var(--gray-600);
    text-transform: uppercase;
    letter-spacing: 0.02em;
    text-align: left;
    border-bottom: 2px solid var(--gray-200);
    white-space: normal;
    word-break: break-word;
    line-height: 1.3;
    user-select: none;
    vertical-align: middle;
    overflow: hidden;
    resize: horizontal;
    min-width: 30px;
}

.data-table tbody td {
    padding: 0.3rem 0.45rem;
    color: var(--gray-700);
    border-bottom: 1px solid var(--gray-100);
    white-space: nowrap;
}

.data-table tbody tr:hover {
    background: var(--brand-50);
}

.data-table tbody td.name-cell {
    font-weight: 600;
    color: var(--gray-900);
}

.data-table tbody td.tc-cell {
    font-family: 'Courier New', monospace;
    font-size: 0.73rem;
}

.data-table tbody tr.row-green {
    background: #f0fdf4;
}

.data-table tbody tr.row-yellow {
    background: #fefce8;
}

.data-table tbody tr.row-red {
    background: #fef2f2;
}

/* Inline Edit — Cell Input */
.cell-input {
    width: 100%;
    min-width: 40px;
    padding: 0.12rem 0.2rem;
    border: 1px solid transparent;
    border-radius: 3px;
    font-size: 0.68rem;
    font-family: inherit;
    color: var(--gray-800);
    background: transparent;
    outline: none;
    transition: all 0.12s;
    box-sizing: border-box;
}

/* Form/modal içindeki inputlara border ver */
.card-body .cell-input,
form .cell-input,
.table-header .cell-input {
    border: 1px solid #d1d5db;
}

.cell-input:hover {
    border-color: var(--gray-300);
    background: var(--white);
}

.cell-input:focus {
    border-color: var(--brand-400);
    background: var(--white);
    box-shadow: 0 0 0 2px rgba(249, 115, 22, 0.08);
}

/* Excel gibi seçili hücre stili */
.cell-input.selected-cell {
    background: #dbeafe !important;
    border-color: #3b82f6 !important;
    box-shadow: inset 0 0 0 1px #3b82f6 !important;
}

td.col-selected {
    background: #eff6ff !important;
}

.cell-input.sm {
    min-width: 35px;
    max-width: 75px;
}

.cell-input.num {
    min-width: 35px;
    max-width: 60px;
    text-align: right;
    font-family: 'Courier New', monospace;
}

.cell-input.tc {
    font-family: 'Courier New', monospace;
    font-size: 0.66rem;
    min-width: 75px;
}

/* Dirty row */
.data-table tbody tr.row-dirty {
    background: #fffbeb;
}

.data-table tbody tr.row-saved {
    background: #f0fdf4;
    transition: background 0.3s;
}

/* New row — canli yesil border */
.data-table tbody tr.new-row {
    background: #f0fdf4;
    border-left: 3px solid var(--green-500);
}

/* Secili satir vurgulama */
.data-table tbody tr.row-selected {
    outline: 2px solid #3b82f6;
    outline-offset: -2px;
    box-shadow: inset 4px 0 0 #3b82f6;
}

.data-table tbody tr.row-selected td:first-child {
    border-left: 3px solid #3b82f6;
}

/* Save button per row */
.save-btn {
    width: 20px;
    height: 20px;
    background: var(--green-500);
    color: #fff;
    border: none;
    border-radius: 4px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 0.6rem;
    transition: all 0.12s;
}

.save-btn:hover {
    background: #16a34a;
    transform: scale(1.1);
}

/* Dropdown inline */
.dropdown-inline {
    position: relative;
    display: inline-block;
}

.dropdown-menu {
    position: absolute;
    top: 100%;
    right: 0;
    background: var(--white);
    border: 1px solid var(--gray-200);
    border-radius: 6px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    min-width: 220px;
    z-index: 50;
    padding: 0.3rem 0;
}

.dropdown-menu a {
    display: block;
    padding: 0.4rem 0.75rem;
    font-size: 0.75rem;
    color: var(--gray-700);
    text-decoration: none;
    transition: background 0.1s;
}

.dropdown-menu a:hover {
    background: var(--brand-50);
    color: var(--brand-700);
}

/* Excel-like table — compact fit-to-screen */
.excel-table {
    table-layout: auto;
    min-width: 1400px;
}

.excel-table .cell-input {
    padding: 0.1rem 0.15rem;
    font-size: 0.66rem;
}

.excel-table th,
.excel-table td {
    padding: 0.2rem 0.15rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-size: 0.68rem;
}

.excel-table th {
    font-size: 0.62rem;
    letter-spacing: -0.02em;
}

/* Row Action Buttons — Düzenle/Sil */
.action-btn-sm {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.65rem;
    transition: all 0.15s;
    background: transparent;
    color: var(--gray-400);
}

.action-btn-sm:hover {
    background: var(--gray-100);
    color: var(--gray-700);
}

.action-btn-sm.edit:hover {
    background: #dbeafe;
    color: #2563eb;
}

.action-btn-sm.delete:hover {
    background: #fee2e2;
    color: #dc2626;
}

.row-actions {
    display: flex;
    gap: 2px;
    align-items: center;
}

/* Data table wrapper — ekrana sığdır, gerekirse yatay scroll */
.data-table-wrapper {
    overflow-x: auto;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

/* Status Badges */
.status-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.1rem 0.4rem;
    border-radius: 4px;
    font-size: 0.65rem;
    font-weight: 600;
}

.status-badge.green {
    background: var(--green-100);
    color: #16a34a;
}

.status-badge.red {
    background: var(--red-100);
    color: #dc2626;
}

.status-badge.amber {
    background: var(--amber-100);
    color: #d97706;
}

.status-badge.blue {
    background: var(--blue-100);
    color: #2563eb;
}

.status-badge.purple {
    background: var(--purple-100);
    color: #7c3aed;
}

/* ============ ROW COLOR CODING — Durum Bazlı Satır Renkleri ============ */
/* Ödeme geldi — açık yeşil */
.data-table tbody tr.row-paid {
    background: #e8f5e9 !important;
}

.data-table tbody tr.row-paid:hover {
    background: #c8e6c9 !important;
}

.data-table tbody tr.row-paid td {
    border-bottom-color: #a5d6a7;
}

/* Sertifika verildi / işleme alındı — koyu yeşil */
.data-table tbody tr.row-delivered {
    background: #c8e6c9 !important;
}

.data-table tbody tr.row-delivered:hover {
    background: #a5d6a7 !important;
}

.data-table tbody tr.row-delivered td {
    border-bottom-color: #81c784;
}

/* İptal — kırmızı */
.data-table tbody tr.row-cancelled {
    background: #ffebee !important;
}

.data-table tbody tr.row-cancelled:hover {
    background: #ffcdd2 !important;
}

.data-table tbody tr.row-cancelled td {
    border-bottom-color: #ef9a9a;
    color: #c62828;
}

/* Kontrol — sarı */
.data-table tbody tr.row-review {
    background: #fff8e1 !important;
}

.data-table tbody tr.row-review:hover {
    background: #ffecb3 !important;
}

.data-table tbody tr.row-review td {
    border-bottom-color: #ffe082;
}

/* İşleme alınacak — beyaz (varsayılan) */
.data-table tbody tr.row-pending {
    background: var(--white) !important;
}

/* Dirty / Saved animasyonlar */
.data-table tbody tr.row-dirty {
    background: #fef3c7 !important;
}

.data-table tbody tr.row-saved {
    background: #d1fae5 !important;
    transition: background 0.5s ease;
}

/* ===== SATIR RENK KODLARI ===== */
/* Ödeme geldi + Sertifika verildi → Açık Yeşil */
.data-table tbody tr.row-paid,
.data-table tbody tr.row-paid_delivered {
    background: #dcfce7 !important;
}

.data-table tbody tr.row-paid td,
.data-table tbody tr.row-paid_delivered td {
    color: #166534;
}

.data-table tbody tr.row-paid_pending {
    background: #f0fdf4 !important;
}

.data-table tbody tr.row-paid_pending td {
    color: #15803d;
}

.data-table tbody tr.row-delivered,
.data-table tbody tr.row-unpaid_delivered {
    background: #86efac !important;
}

.data-table tbody tr.row-delivered td,
.data-table tbody tr.row-unpaid_delivered td {
    color: #14532d;
}

.data-table tbody tr.row-unpaid_pending {
    background: #ffedd5 !important;
}

.data-table tbody tr.row-unpaid_pending td {
    color: #9a3412;
}

.data-table tbody tr.row-system_entered td[data-field="company_name"] {
    background: #86efac !important;
    color: #14532d;
    font-weight: 600;
}

.data-table tbody tr.row-review {
    background: #fef9c3 !important;
}

.data-table tbody tr.row-review td {
    color: #854d0e;
}

.data-table tbody tr.row-cancelled {
    background: #fee2e2 !important;
}

.data-table tbody tr.row-cancelled td {
    color: #991b1b;
}

.data-table tbody tr.row-gift {
    background: #ede9fe !important;
}

.data-table tbody tr.row-gift td {
    color: #5b21b6;
}

.data-table tbody tr.row-pending {
    background: var(--white) !important;
}

tr.new-row {
    background: #eff6ff !important;
    border-left: 3px solid var(--brand-500);
}

/* Save button */
.save-btn {
    background: #16a34a;
    color: #fff;
    border: none;
    border-radius: 4px;
    padding: 0.15rem 0.3rem;
    cursor: pointer;
    font-size: 0.65rem;
    display: inline-flex;
    align-items: center;
    transition: all 0.15s;
}

.save-btn:hover {
    background: #15803d;
    transform: scale(1.05);
}

/* Ödeme checkbox */
.pay-check {
    width: 14px;
    height: 14px;
    cursor: pointer;
    accent-color: #16a34a;
}

/* ============================================================
   PAGE HEADER (for sub-pages)
   ============================================================ */
.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.6rem;
}

.page-header h1 {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--gray-900);
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.page-header h1 i {
    color: var(--brand-500);
}

.page-header-actions {
    display: flex;
    align-items: center;
    gap: 0.35rem;
}

/* ============================================================
   FORM PANELS (for create/edit pages)
   ============================================================ */
.form-card {
    background: var(--white);
    border: 1px solid var(--gray-200);
    border-radius: 8px;
    padding: 1rem;
    margin-bottom: 0.75rem;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.6rem;
}

.form-grid .form-group {
    margin-bottom: 0;
}

.form-grid .span-2 {
    grid-column: span 2;
}

.form-grid .span-4 {
    grid-column: span 4;
}

.form-group select {
    width: 100%;
    padding: 0.55rem 0.65rem;
    border: 1px solid var(--gray-200);
    border-radius: 6px;
    font-size: 0.82rem;
    font-family: inherit;
    color: var(--gray-800);
    background: var(--white);
    outline: none;
}

.form-group select:focus {
    border-color: var(--brand-500);
}

.form-group textarea {
    width: 100%;
    padding: 0.55rem 0.65rem;
    border: 1px solid var(--gray-200);
    border-radius: 6px;
    font-size: 0.82rem;
    font-family: inherit;
    color: var(--gray-800);
    resize: vertical;
    outline: none;
    min-height: 60px;
}

.form-group textarea:focus {
    border-color: var(--brand-500);
}

.form-group .plain-input {
    width: 100%;
    padding: 0.55rem 0.65rem;
    border: 1px solid var(--gray-200);
    border-radius: 6px;
    font-size: 0.82rem;
    font-family: inherit;
    color: var(--gray-800);
    outline: none;
}

.form-group .plain-input:focus {
    border-color: var(--brand-500);
    box-shadow: 0 0 0 2px rgba(249, 115, 22, 0.08);
}

/* ============================================================
   CARDS
   ============================================================ */
.card {
    background: var(--white);
    border: 1px solid var(--gray-200);
    border-radius: 8px;
    margin-bottom: 0.6rem;
}

.card-head {
    padding: 0.5rem 0.75rem;
    border-bottom: 1px solid var(--gray-100);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.card-head h3 {
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--gray-800);
}

.card-body {
    padding: 0.6rem 0.75rem;
}

.dash-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.6rem;
    margin-bottom: 0.6rem;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 2.5rem 1rem;
    color: var(--gray-400);
}

.empty-state i {
    font-size: 2rem;
    margin-bottom: 0.5rem;
    display: block;
}

.empty-state p {
    font-size: 0.85rem;
}

/* ============================================================
   TOAST
   ============================================================ */
.toast-container {
    position: fixed;
    top: 0.75rem;
    right: 0.75rem;
    z-index: 10000;
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.toast {
    background: var(--white);
    border: 1px solid var(--gray-200);
    border-radius: 7px;
    padding: 0.55rem 0.85rem;
    min-width: 240px;
    max-width: 340px;
    color: var(--gray-800);
    font-size: 0.8rem;
    display: flex;
    align-items: center;
    gap: 0.45rem;
    animation: toastIn 0.25s ease-out;
    box-shadow: 0 3px 12px rgba(0, 0, 0, 0.08);
}

.toast.success {
    border-left: 3px solid var(--green-500);
}

.toast.error {
    border-left: 3px solid var(--red-500);
}

.toast.warning {
    border-left: 3px solid var(--amber-500);
}

.toast.info {
    border-left: 3px solid var(--blue-500);
}

@keyframes toastIn {
    from {
        opacity: 0;
        transform: translateX(20px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 1200px) {
    .action-grid {
        grid-template-columns: repeat(3, 1fr);
    }

    .form-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 1024px) {
    .tools-row {
        grid-template-columns: repeat(2, 1fr);
    }

    .dash-grid {
        grid-template-columns: 1fr;
    }

    .form-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .login-left {
        display: none;
    }

    .sidebar {
        transform: translateX(-100%);
    }

    .sidebar.mobile-open {
        transform: translateX(0);
    }

    .main-content {
        margin-left: 0 !important;
    }

    .action-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .form-grid {
        grid-template-columns: 1fr;
    }
}

/* ===== GLOBAL SEARCHABLE SELECT (Combobox) ===== */
.ss-wrap {
    position: relative;
    display: inline-block;
    min-width: 120px;
}

.ss-wrap.full {
    display: block;
    width: 100%;
}

.ss-trigger {
    width: 100%;
    padding: 5px 26px 5px 8px;
    border: 1px solid var(--gray-200);
    border-radius: 6px;
    font-size: 0.75rem;
    background: #fff;
    cursor: pointer;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: var(--gray-700);
    text-align: left;
    position: relative;
}

.ss-trigger::after {
    content: '\f078';
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    position: absolute;
    right: 7px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 0.55rem;
    color: var(--gray-400);
}

.ss-trigger:hover {
    border-color: var(--gray-300);
}

.ss-dropdown {
    position: absolute;
    top: calc(100% + 2px);
    left: 0;
    right: 0;
    min-width: 180px;
    background: #fff;
    border: 1px solid var(--gray-200);
    border-radius: 8px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
    z-index: 200;
    display: none;
    overflow: hidden;
}

.ss-wrap.open .ss-dropdown {
    display: block;
}

.ss-search {
    width: 100%;
    padding: 7px 10px;
    border: none;
    border-bottom: 1px solid var(--gray-100);
    font-size: 0.78rem;
    outline: none;
    box-sizing: border-box;
}

.ss-search:focus {
    border-bottom-color: var(--brand-400);
}

.ss-options {
    max-height: 200px;
    overflow-y: auto;
}

.ss-opt {
    padding: 6px 10px;
    font-size: 0.75rem;
    cursor: pointer;
    transition: background 0.08s;
}

.ss-opt:hover {
    background: var(--brand-50);
    color: var(--brand-600);
}

.ss-opt.active {
    background: var(--brand-50);
    font-weight: 600;
    color: var(--brand-600);
}

.ss-opt.active::before {
    content: '\f00c';
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    margin-right: 5px;
    font-size: 0.55rem;
}