/* ========================================
    Muhasebe Sistemi - PREMIUM CORPORATE THEME
    Modern & Professional Design System
   ======================================== */

/* ─── Design Tokens ─────────────────────────────────────────────────────── */
:root {
    /* Brand Palette */
    --primary-color: #162E4D;
    --secondary-color: #1d3a5c;
    --accent-color: #4a90d9;
    --accent-hover: #3a7bc8;
    --accent-light: #e0ecfa;
    --accent-subtle: #edf3fc;

    /* Semantic Colors */
    --success-color: #2d8659;
    --success-light: #e3f4eb;
    --warning-color: #b8860b;
    --warning-light: #fdf4dc;
    --danger-color: #b91c1c;
    --danger-light: #fde8e8;
    --info-color: #4a6fa5;
    --info-light: #e5eef8;

    /* Neutrals */
    --light-bg: #eceef2;
    --page-bg: #F4F6F9;
    --dark-bg: #162E4D;
    --border-color: #dee2e8;
    --border-light: #eceef2;
    --text-primary: #1a2332;
    --text-secondary: #4a5568;
    --text-muted: #7a8599;
    --white: #FFFFFF;

    /* Elevation */
    --shadow-xs: 0 1px 2px rgba(0,0,0,0.06);
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.08), 0 1px 2px rgba(0,0,0,0.05);
    --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.08), 0 2px 4px -2px rgba(0,0,0,0.05);
    --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.10), 0 4px 6px -4px rgba(0,0,0,0.05);
    --shadow-xl: 0 20px 25px -5px rgba(0,0,0,0.10), 0 8px 10px -6px rgba(0,0,0,0.05);
    --shadow-blue: 0 4px 14px rgba(79,110,150,0.25);

    /* Motion */
    --transition-fast: 0.15s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-normal: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: 0.35s cubic-bezier(0.4, 0, 0.2, 1);

    /* Radius */
    --border-radius-sm: 0.5rem;
    --border-radius-md: 0.625rem;
    --border-radius-lg: 0.875rem;
    --border-radius-xl: 1.25rem;
    --border-radius-full: 9999px;

    /* Sidebar */
    --sidebar-width: 250px;
    --sidebar-bg: #162E4D;
    --sidebar-text: #94a7c0;
    --sidebar-text-active: #e8edf4;
    --sidebar-accent: var(--accent-color);
}

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

html {
    font-size: 16px;
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background-color: var(--page-bg);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    letter-spacing: -0.011em;
}

img, video, canvas, svg {
    max-width: 100%;
    height: auto;
}

.responsive-scroll {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

body.sidebar-open {
    overflow: hidden;
}

.mobile-only { display: none; }
.mobile-hide { display: block; }

/* ─── Typography ────────────────────────────────────────────────────────── */
h1, h2, h3, h4, h5, h6 {
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 1rem;
    letter-spacing: -0.025em;
    line-height: 1.3;
}

.text-primary { color: var(--primary-color) !important; }
.text-accent { color: var(--accent-color) !important; }

::selection {
    background: var(--accent-light);
    color: var(--accent-hover);
}

/* ─── Navbar ────────────────────────────────────────────────────────────── */
.navbar {
    background: #162E4D !important;
    border-bottom: 1px solid rgba(255,255,255,0.08);
    box-shadow: var(--shadow-sm);
    padding: 0 1.25rem;
    height: 64px;
    position: sticky;
    top: 0;
    z-index: 1030;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

.navbar-brand {
    font-weight: 800;
    font-size: 1.15rem;
    color: #e2e8f0 !important;
    letter-spacing: -0.02em;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.navbar-brand i {
    color: #5ba3e6;
    font-size: 1.3rem;
    margin-right: 0;
}

.navbar-nav .nav-link {
    color: #a8b4c4 !important;
    font-weight: 500;
    padding: 0.5rem 0.875rem !important;
    border-radius: var(--border-radius-sm);
    transition: var(--transition-fast);
    font-size: 0.9rem;
}

.navbar-nav .nav-link:hover,
.navbar-nav .nav-link.active {
    color: #e2e8f0 !important;
    background-color: rgba(255,255,255,0.08);
}

.navbar-toggler {
    border: none;
    padding: 0.5rem;
    color: #e2e8f0;
}

.navbar-toggler:focus {
    box-shadow: none;
}

.navbar-toggler-icon {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='%23e2e8f0' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='m4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e");
}

/* Navbar search */
.navbar .input-group {
    max-width: 400px;
}

.navbar .input-group .input-group-text {
    background: rgba(255,255,255,0.08);
    border: 1px solid rgba(255,255,255,0.15);
    border-right: none;
    color: #8899aa;
    border-radius: var(--border-radius-full) 0 0 var(--border-radius-full);
    padding-left: 1rem;
}

.navbar .input-group .form-control {
    background: rgba(255,255,255,0.08);
    border: 1px solid rgba(255,255,255,0.15);
    border-left: none;
    border-radius: 0 var(--border-radius-full) var(--border-radius-full) 0;
    font-size: 0.875rem;
    color: #e2e8f0;
}

.navbar .input-group .form-control::placeholder {
    color: #8899aa;
}

.navbar .input-group .form-control:focus {
    background: rgba(255,255,255,0.12);
    box-shadow: none;
    border-color: rgba(126,176,224,0.4);
    color: #e2e8f0;
}

.navbar .input-group .form-control:focus + .input-group-text,
.navbar .input-group:focus-within .input-group-text {
    border-color: rgba(126,176,224,0.4);
    background: rgba(255,255,255,0.12);
}

/* Sidebar toggle in navbar */
.sidebar-toggle {
    color: #a8b4c4 !important;
    text-decoration: none;
    width: 40px;
    height: 40px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--border-radius-sm);
    transition: var(--transition-fast);
    padding: 0;
}

.sidebar-toggle:hover {
    background: rgba(255,255,255,0.08);
    color: #e2e8f0 !important;
}

/* User dropdown */
.navbar .dropdown-toggle {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: #a8b4c4;
}

.navbar .dropdown-toggle .bi-person-circle {
    font-size: 1.25rem;
    color: #5ba3e6;
}

/* ─── Sidebar ───────────────────────────────────────────────────────────── */
.sidebar {
    background: var(--sidebar-bg);
    min-height: calc(100vh - 64px);
    border-right: 1px solid rgba(255,255,255,0.06);
    position: sticky;
    top: 64px;
    width: var(--sidebar-width);
    overflow-y: auto;
    overflow-x: hidden;
}

.sidebar::-webkit-scrollbar {
    width: 4px;
}

.sidebar::-webkit-scrollbar-thumb {
    background: rgba(255,255,255,0.15);
    border-radius: 4px;
}

.sidebar .p-3 {
    padding: 0.75rem !important;
}

.sidebar .nav-link {
    color: var(--sidebar-text);
    padding: 0.6rem 1rem;
    border-left: 3px solid transparent;
    transition: var(--transition-fast);
    display: flex;
    align-items: center;
    font-weight: 500;
    font-size: 0.875rem;
    border-radius: 0 var(--border-radius-sm) var(--border-radius-sm) 0;
    margin-bottom: 1px;
    position: relative;
}

.sidebar .nav-link i {
    width: 22px;
    margin-right: 0.75rem;
    text-align: center;
    font-size: 1.05rem;
    opacity: 0.6;
    transition: var(--transition-fast);
}

.sidebar .nav-link:hover {
    color: #e2e8f0;
    background: rgba(255,255,255,0.06);
    border-left-color: transparent;
}

.sidebar .nav-link:hover i {
    opacity: 1;
    color: #5ba3e6;
}

.sidebar .nav-link.active {
    color: var(--sidebar-text-active);
    background: rgba(74,144,217,0.15);
    border-left-color: #4a90d9;
    font-weight: 600;
}

.sidebar .nav-link.active i {
    opacity: 1;
    color: #5ba3e6;
}

.sidebar .border-top {
    border-color: rgba(255,255,255,0.08) !important;
}

/* ─── Cards ─────────────────────────────────────────────────────────────── */
.card {
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow-sm);
    transition: var(--transition-normal);
    overflow: hidden;
    background: var(--white);
}

.card:hover {
    box-shadow: var(--shadow-md);
}

.card-header {
    background-color: var(--white);
    border-bottom: 1px solid var(--border-color);
    padding: 1rem 1.25rem;
    font-weight: 600;
}

.card-header h5, .card-header h6 {
    margin: 0;
}

.card-body {
    padding: 1.25rem;
}

.card-footer {
    background-color: var(--light-bg);
    border-top: 1px solid var(--border-color);
    padding: 1rem 1.25rem;
}

/* Cards with border- accents */
.card.border-primary {
    border-color: var(--accent-color) !important;
    border-left: 4px solid var(--accent-color);
}

.card.border-danger {
    border-color: var(--danger-color) !important;
    border-left: 4px solid var(--danger-color);
}

.card.border-warning {
    border-color: var(--warning-color) !important;
    border-left: 4px solid var(--warning-color);
}

/* Colored card headers - keep them subtle */
.card-header.bg-primary {
    background: var(--accent-color) !important;
    border-bottom: none;
}

.card-header.bg-danger {
    background: var(--danger-color) !important;
    border-bottom: none;
}

.card-header.bg-warning {
    background: var(--warning-color) !important;
    color: #fff !important;
    border-bottom: none;
}

.card-header.bg-success {
    background: var(--success-color) !important;
    border-bottom: none;
}

.card-header.bg-info {
    background: var(--info-color) !important;
    border-bottom: none;
}

/* ─── Stat Cards ────────────────────────────────────────────────────────── */
.stat-card {
    position: relative;
    overflow: hidden;
    background: var(--white);
    border-radius: var(--border-radius-lg);
    padding: 1.5rem;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    gap: 1rem;
    min-height: 100px;
    transition: var(--transition-normal);
}

.stat-card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    border-radius: 4px 0 0 4px;
}

.stat-card.primary::before { background: var(--accent-color); }
.stat-card.success::before { background: var(--success-color); }
.stat-card.warning::before { background: var(--warning-color); }
.stat-card.danger::before { background: var(--danger-color); }
.stat-card.info::before { background: var(--info-color); }

.stat-card .stat-icon {
    width: 56px;
    height: 56px;
    min-width: 56px;
    border-radius: var(--border-radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    flex-shrink: 0;
}

.stat-card.primary .stat-icon { background: var(--accent-subtle); color: var(--accent-color); }
.stat-card.success .stat-icon { background: var(--success-light); color: var(--success-color); }
.stat-card.warning .stat-icon { background: var(--warning-light); color: var(--warning-color); }
.stat-card.danger .stat-icon { background: var(--danger-light); color: var(--danger-color); }
.stat-card.info .stat-icon { background: var(--info-light); color: var(--info-color); }

.stat-card .stat-content {
    flex: 1;
    min-width: 0;
}

.stat-card .stat-content h3,
.stat-card .stat-value {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--text-primary);
    margin: 0;
    line-height: 1.2;
    word-break: break-word;
    letter-spacing: -0.03em;
}

.stat-card .stat-content p,
.stat-card .stat-label {
    color: var(--text-muted);
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    font-weight: 600;
    margin: 0.25rem 0 0 0;
}

/* Dashboard card-wrapped stat cards */
.card.stat-card {
    display: block;
    padding: 0;
}

.card.stat-card .card-body {
    padding: 1rem 1.25rem;
}

.card.stat-card .stat-icon {
    width: 48px;
    height: 48px;
    min-width: 48px;
}

/* ─── Form Controls ─────────────────────────────────────────────────────── */
.form-control, .form-select {
    border-radius: var(--border-radius-sm);
    border: 1.5px solid var(--border-color);
    padding: 0.625rem 0.875rem;
    font-size: 0.9375rem;
    transition: var(--transition-fast);
    background-color: var(--white);
    color: var(--text-primary);
}

.form-control:focus, .form-select:focus {
    border-color: var(--accent-color);
    box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.1);
}

.form-control::placeholder {
    color: var(--text-muted);
}

.form-label {
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    font-size: 0.875rem;
}

.form-label .text-danger {
    margin-left: 0;
    font-weight: 700;
}

.form-label + .btn,
.d-flex.form-label-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}

.form-label .btn {
    padding: 0.25rem 0.5rem;
    font-size: 0.75rem;
    line-height: 1;
}

.form-label .btn i {
    margin-right: 0.25rem;
}

.form-text {
    color: var(--text-muted);
    font-size: 0.8125rem;
}

.input-group-text {
    background-color: var(--light-bg);
    border: 1.5px solid var(--border-color);
    color: var(--text-secondary);
    font-size: 0.9375rem;
}

/* Floating Labels */
.form-floating > .form-control,
.form-floating > .form-select {
    height: calc(3.5rem + 3px);
    padding: 1rem 0.875rem;
}

.form-floating > label {
    padding: 1rem 0.875rem;
}

/* ─── Buttons ───────────────────────────────────────────────────────────── */
.btn {
    border-radius: var(--border-radius-sm);
    padding: 0.5rem 1.25rem;
    font-weight: 600;
    transition: var(--transition-fast);
    border: none;
    font-size: 0.875rem;
    letter-spacing: -0.01em;
    position: relative;
}

.btn:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-sm);
}

.btn:active {
    transform: translateY(0);
    box-shadow: none;
}

.btn-primary {
    background: var(--accent-color);
    color: #fff;
}

.btn-primary:hover {
    background: var(--accent-hover);
    box-shadow: var(--shadow-blue);
}

.btn-success {
    background: var(--success-color);
}

.btn-success:hover {
    background: #246e49;
}

.btn-danger {
    background: var(--danger-color);
}

.btn-danger:hover {
    background: #991b1b;
}

.btn-warning {
    background: var(--warning-color);
    color: #fff;
}

.btn-warning:hover {
    background: #996108;
    color: #fff;
}

.btn-secondary {
    background: var(--secondary-color);
}

.btn-secondary:hover {
    background: var(--primary-color);
}

.btn-info {
    background: var(--info-color);
    color: #fff;
}

.btn-info:hover {
    background: #3d5a80;
    color: #fff;
}

.btn-outline-primary {
    border: 1.5px solid var(--accent-color);
    color: var(--accent-color);
    background: transparent;
}

.btn-outline-primary:hover {
    background: var(--accent-color);
    color: #fff;
    box-shadow: var(--shadow-blue);
}

.btn-outline-secondary {
    border: 1.5px solid var(--border-color);
    color: var(--text-secondary);
    background: transparent;
}

.btn-outline-secondary:hover {
    background: var(--light-bg);
    border-color: var(--text-secondary);
    color: var(--text-primary);
}

.btn-outline-info {
    border: 1.5px solid var(--info-color);
    color: var(--info-color);
    background: transparent;
}

.btn-outline-info:hover {
    background: var(--info-color);
    color: #fff;
}

.btn-outline-warning {
    border: 1.5px solid var(--warning-color);
    color: var(--warning-color);
    background: transparent;
}

.btn-outline-warning:hover {
    background: var(--warning-color);
    color: #fff;
}

.btn-outline-danger {
    border: 1.5px solid var(--danger-color);
    color: var(--danger-color);
    background: transparent;
}

.btn-outline-danger:hover {
    background: var(--danger-color);
    color: #fff;
}

.btn-sm {
    padding: 0.35rem 0.75rem;
    font-size: 0.8125rem;
    border-radius: 0.375rem;
}

.btn-lg {
    padding: 0.75rem 1.75rem;
    font-size: 1.0625rem;
    border-radius: var(--border-radius-md);
}

.btn-icon {
    width: 36px;
    height: 36px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.btn-icon.btn-sm {
    width: 30px;
    height: 30px;
}

/* Button link reset */
.btn-link {
    border: none;
    background: none;
    box-shadow: none !important;
    transform: none !important;
}

/* ─── Tables ────────────────────────────────────────────────────────────── */
.table {
    margin-bottom: 0;
}

.table thead th {
    background-color: var(--light-bg);
    border-bottom: 2px solid var(--border-color);
    font-weight: 700;
    color: var(--text-secondary);
    padding: 0.75rem 1rem;
    white-space: nowrap;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.table tbody td {
    padding: 0.875rem 1rem;
    vertical-align: middle;
    border-color: var(--border-light);
    color: var(--text-primary);
    font-size: 0.875rem;
    background-color: transparent;
}

.table tbody tr {
    transition: var(--transition-fast);
    background-color: transparent;
}

.table tbody tr:hover {
    background-color: rgba(90,126,170,0.06);
}

.table-striped > tbody > tr:nth-of-type(odd) > * {
    background-color: rgba(0,0,0,0.015);
}

.table-responsive {
    border-radius: var(--border-radius-lg);
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
}

/* ─── DataTables ────────────────────────────────────────────────────────── */
.dataTables_wrapper {
    padding: 1rem 0;
    overflow: visible;
}

.dataTables_wrapper .row,
.dataTables_wrapper [class^="col-"],
.dataTables_wrapper [class*=" col-"] {
    overflow: visible;
}

.dataTables_wrapper .dataTables_length,
.dataTables_wrapper .dataTables_filter {
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.dataTables_wrapper .dataTables_filter {
    justify-content: flex-end;
}

.dataTables_wrapper .dataTables_filter label {
    justify-content: flex-end;
}

.dataTables_wrapper .dataTables_length label,
.dataTables_wrapper .dataTables_filter label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0;
    white-space: nowrap;
    color: var(--text-secondary);
    font-size: 0.875rem;
}

.dataTables_wrapper .dataTables_length select {
    border-radius: var(--border-radius-sm);
    border: 1.5px solid var(--border-color);
    padding: 0.375rem 2rem 0.375rem 0.75rem;
    font-size: 0.875rem;
    min-width: 70px;
    appearance: auto;
    background-color: var(--white);
    background-image: none;
}

.dataTables_wrapper .dataTables_filter input {
    border-radius: var(--border-radius-full);
    border: 1.5px solid var(--border-color);
    padding: 0.5rem 1rem;
    min-width: 200px;
    background: var(--light-bg);
    transition: var(--transition-fast);
}

.dataTables_wrapper .dataTables_filter input:focus {
    border-color: var(--accent-color);
    box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.1);
    outline: none;
    background: var(--white);
}

.dataTables_wrapper .dataTables_paginate .paginate_button {
    border-radius: var(--border-radius-sm) !important;
    margin: 0 2px;
}

.dataTables_wrapper .dataTables_paginate,
.dataTables_wrapper .dataTables_paginate .pagination {
    white-space: nowrap;
    flex-wrap: nowrap;
}

.dataTables_wrapper .dataTables_paginate {
    overflow: visible;
}

.dataTables_wrapper .dataTables_paginate .paginate_button.current {
    background: var(--accent-color) !important;
    border-color: var(--accent-color) !important;
    color: #fff !important;
    font-weight: 600;
}

.dataTables_wrapper .dataTables_paginate .paginate_button:hover {
    background: var(--light-bg) !important;
    border-color: var(--border-color) !important;
}

.dataTables_wrapper .dataTables_info {
    color: var(--text-muted);
    padding-top: 1rem;
    font-size: 0.8125rem;
}

.dt-page-hidden {
    display: none !important;
}

/* ─── Badges ────────────────────────────────────────────────────────────── */
.badge {
    padding: 0.35rem 0.65rem;
    font-weight: 600;
    font-size: 0.7rem;
    letter-spacing: 0.02em;
    border-radius: var(--border-radius-full);
}

.badge.bg-success {
    background: var(--success-light) !important;
    color: #1a5e3a !important;
}

.badge.bg-info {
    background: var(--info-light) !important;
    color: #2e4a73 !important;
}

.badge.bg-warning {
    background: var(--warning-light) !important;
    color: #7a5a09 !important;
}

.badge.bg-danger {
    background: var(--danger-light) !important;
    color: #7f1d1d !important;
}

.badge.bg-secondary {
    background: var(--light-bg) !important;
    color: var(--text-secondary) !important;
}

.badge.bg-primary {
    background: var(--accent-light) !important;
    color: #1e40af !important;
}

.badge-soft-primary {
    background-color: var(--accent-light);
    color: var(--accent-color);
}

.badge-soft-success {
    background-color: var(--success-light);
    color: var(--success-color);
}

.badge-soft-warning {
    background-color: var(--warning-light);
    color: var(--warning-color);
}

.badge-soft-danger {
    background-color: var(--danger-light);
    color: var(--danger-color);
}

/* ─── Alerts ────────────────────────────────────────────────────────────── */
.alert {
    border: none;
    border-radius: var(--border-radius-md);
    padding: 1rem 1.25rem;
    border-left: 4px solid;
    font-size: 0.9rem;
}

.alert-success {
    background-color: var(--success-light);
    border-left-color: var(--success-color);
    color: #065f46;
}

.alert-danger {
    background-color: var(--danger-light);
    border-left-color: var(--danger-color);
    color: #991b1b;
}

.alert-warning {
    background-color: var(--warning-light);
    border-left-color: var(--warning-color);
    color: #92400e;
}

.alert-info {
    background-color: var(--accent-light);
    border-left-color: var(--accent-color);
    color: #1e40af;
}

/* ─── Modals ────────────────────────────────────────────────────────────── */
.modal-content {
    border: none;
    border-radius: var(--border-radius-xl);
    box-shadow: var(--shadow-xl);
}

.modal-header {
    border-bottom: 1px solid var(--border-color);
    padding: 1.25rem 1.5rem;
}

.modal-title {
    font-weight: 700;
    font-size: 1.1rem;
}

.modal-body {
    padding: 1.5rem;
}

.modal-footer {
    border-top: 1px solid var(--border-color);
    padding: 1rem 1.5rem;
}

/* ─── Dropdowns ─────────────────────────────────────────────────────────── */
.dropdown-menu {
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-md);
    box-shadow: var(--shadow-lg);
    padding: 0.5rem;
    background: var(--white);
    animation: dropdownFadeIn 0.15s ease-out;
}

@keyframes dropdownFadeIn {
    from { opacity: 0; transform: translateY(-4px); }
    to { opacity: 1; transform: translateY(0); }
}

.dropdown-item {
    border-radius: var(--border-radius-sm);
    padding: 0.5rem 1rem;
    font-weight: 500;
    transition: var(--transition-fast);
    font-size: 0.875rem;
}

.dropdown-item:hover {
    background-color: var(--accent-subtle);
    color: var(--accent-color);
}

.dropdown-item i {
    width: 20px;
    margin-right: 0.5rem;
    opacity: 0.7;
}

.dropdown-divider {
    border-color: var(--border-color);
    margin: 0.35rem 0;
}

/* ─── Pagination ────────────────────────────────────────────────────────── */
.pagination {
    margin: 0;
}

.page-link {
    border: none;
    border-radius: var(--border-radius-sm) !important;
    color: var(--text-primary);
    padding: 0.5rem 0.875rem;
    margin: 0 2px;
    font-weight: 500;
    font-size: 0.875rem;
    transition: var(--transition-fast);
}

.page-link:hover {
    background-color: var(--light-bg);
    color: var(--accent-color);
}

.page-item.active .page-link {
    background-color: var(--accent-color);
    color: #fff;
}

/* ─── Breadcrumb ────────────────────────────────────────────────────────── */
.breadcrumb {
    background-color: transparent;
    padding: 0;
    margin-bottom: 1.5rem;
    font-size: 0.875rem;
}

.breadcrumb-item a {
    color: var(--accent-color);
    text-decoration: none;
}

.breadcrumb-item.active {
    color: var(--text-muted);
}

/* ─── Product Suggestions ───────────────────────────────────────────────── */
.suggestions-container {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--white);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-md);
    box-shadow: var(--shadow-lg);
    z-index: 1050;
    max-height: 200px;
    overflow-y: auto;
    display: none;
}

.suggestions-container.show {
    display: block;
}

.suggestion-item {
    padding: 0.75rem 1rem;
    cursor: pointer;
    transition: var(--transition-fast);
    border-bottom: 1px solid var(--border-light);
}

.suggestion-item:last-child {
    border-bottom: none;
}

.suggestion-item:hover {
    background-color: var(--accent-subtle);
}

.suggestion-item .badge {
    font-size: 0.6875rem;
}

/* Quick Add Modal */
.quick-add-btn {
    white-space: nowrap;
}

/* Number Inputs */
.number-input {
    text-align: right;
}

/* VAT Calculation Checkbox */
.vat-calc-container {
    background-color: var(--light-bg);
    padding: 0.75rem 1rem;
    border-radius: var(--border-radius-md);
    margin-bottom: 1rem;
    border: 1px solid var(--border-color);
}

.vat-calc-container .form-check-label {
    font-weight: 500;
}

/* ─── Loading Spinner ───────────────────────────────────────────────────── */
.spinner-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

/* ─── Page Header ───────────────────────────────────────────────────────── */
.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.75rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.page-header h1 {
    font-size: 1.5rem;
    margin: 0;
    font-weight: 800;
    letter-spacing: -0.03em;
}

.page-header h1 i {
    color: var(--accent-color);
    margin-right: 0.5rem;
}

/* ─── Content Wrapper ───────────────────────────────────────────────────── */
.content-wrapper {
    padding: 1.75rem 2rem;
    min-height: calc(100vh - 64px);
    max-width: 100%;
}

/* ─── Mobile Bottom Navigation ──────────────────────────────────────────── */
.mobile-bottom-nav {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    background: #162E4D;
    border-top: 1px solid rgba(255,255,255,0.08);
    box-shadow: 0 -4px 16px rgba(0, 0, 0, 0.15);
    z-index: 1045;
    padding: 0.35rem 0.25rem;
    backdrop-filter: blur(12px);
}

.mobile-bottom-nav .nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.25rem;
}

.mobile-bottom-nav .nav-item {
    flex: 1 1 0;
    text-align: center;
}

.mobile-bottom-nav .nav-link {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.15rem;
    padding: 0.35rem 0.25rem;
    font-size: 0.75rem;
    color: #8899aa;
    transition: var(--transition-fast);
    border-radius: var(--border-radius-sm);
}

.mobile-bottom-nav .nav-link i {
    font-size: 1.2rem;
}

.mobile-bottom-nav .nav-link.active {
    color: #5ba3e6;
    font-weight: 600;
    background: rgba(74,144,217,0.15);
}

.mobile-bottom-nav .nav-link.active i {
    color: #5ba3e6;
}

.mobile-bottom-nav .nav-link:active {
    transform: scale(0.95);
}

.mobile-more-list .list-group-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    border-color: var(--border-light);
}

#mobileMoreMenu .offcanvas-body {
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    max-height: 60vh;
}

/* ─── Empty State ───────────────────────────────────────────────────────── */
.empty-state {
    text-align: center;
    padding: 3rem;
    color: var(--text-muted);
}

.empty-state i {
    font-size: 4rem;
    opacity: 0.25;
    margin-bottom: 1rem;
}

.empty-state h5 {
    color: var(--text-muted);
}

/* ─── Receipt Styles ────────────────────────────────────────────────────── */
.receipt-preview {
    background: var(--white);
    padding: 2rem;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-lg);
}

.receipt-header {
    text-align: center;
    border-bottom: 2px solid var(--primary-color);
    padding-bottom: 1rem;
    margin-bottom: 1.5rem;
}

.receipt-header h3 {
    margin: 0;
    color: var(--primary-color);
}

.receipt-details {
    margin-bottom: 1.5rem;
}

.receipt-details .row {
    margin-bottom: 0.5rem;
}

.receipt-details .label {
    font-weight: 600;
    color: var(--text-secondary);
}

.receipt-total {
    background: linear-gradient(135deg, var(--light-bg) 0%, var(--accent-subtle) 100%);
    padding: 1rem;
    border-radius: var(--border-radius-md);
    text-align: right;
    border: 1px solid var(--border-color);
}

.receipt-total .total-value {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--text-primary);
}

/* ─── Report Styles ─────────────────────────────────────────────────────── */
.report-summary {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}

.summary-item {
    background: var(--white);
    padding: 1.25rem;
    border-radius: var(--border-radius-md);
    box-shadow: var(--shadow-sm);
    text-align: center;
    border: 1px solid var(--border-color);
}

.summary-item .value {
    font-size: 1.5rem;
    font-weight: 800;
}

.summary-item .label {
    color: var(--text-muted);
    font-size: 0.875rem;
}

.summary-item.receivable .value { color: var(--success-color); }
.summary-item.payable .value { color: var(--danger-color); }

/* ─── Timeline ──────────────────────────────────────────────────────────── */
.timeline {
    position: relative;
    padding-left: 2rem;
}

.timeline::before {
    content: '';
    position: absolute;
    left: 8px;
    top: 0;
    bottom: 0;
    width: 2px;
    background: var(--border-color);
}

.timeline-item {
    position: relative;
    padding-bottom: 1.5rem;
}

.timeline-item::before {
    content: '';
    position: absolute;
    left: -1.5rem;
    top: 0.25rem;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--accent-color);
    border: 3px solid var(--white);
    box-shadow: 0 0 0 2px var(--accent-color);
}

.timeline-item.create::before { background: var(--success-color); box-shadow: 0 0 0 2px var(--success-color); }
.timeline-item.update::before { background: var(--warning-color); box-shadow: 0 0 0 2px var(--warning-color); }
.timeline-item.delete::before { background: var(--danger-color); box-shadow: 0 0 0 2px var(--danger-color); }

.timeline-content {
    background: var(--white);
    padding: 1rem;
    border-radius: var(--border-radius-md);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
}

.timeline-time {
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* ─── Login Page ────────────────────────────────────────────────────────── */
.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #0e1f38 0%, #162E4D 50%, #1d3a5c 100%);
    padding: 1rem;
    position: relative;
    overflow: hidden;
}

.login-page::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle at 30% 50%, rgba(74, 144, 217, 0.1) 0%, transparent 50%),
                radial-gradient(circle at 70% 80%, rgba(74, 144, 217, 0.06) 0%, transparent 40%);
    pointer-events: none;
}

.login-card {
    width: 100%;
    max-width: 420px;
    padding: 2.5rem;
    background: var(--white);
    border-radius: var(--border-radius-xl);
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.2);
    position: relative;
}

.login-card .form-control {
    padding: 0.625rem 0.875rem;
    font-size: 0.9375rem;
}

.login-card .input-group {
    display: flex;
    flex-wrap: nowrap;
}

.login-card .input-group .input-group-text {
    display: flex;
    align-items: center;
    padding: 0.625rem 0.875rem;
    background-color: var(--light-bg);
    border: 1.5px solid var(--border-color);
    border-right: none;
    border-radius: var(--border-radius-sm) 0 0 var(--border-radius-sm);
}

.login-card .input-group .form-control {
    border-radius: 0 var(--border-radius-sm) var(--border-radius-sm) 0;
    border-left: none;
}

.login-card .btn-primary {
    padding: 0.75rem 1.25rem;
    font-size: 1rem;
    font-weight: 700;
}

.login-logo {
    text-align: center;
    margin-bottom: 2rem;
}

.login-logo i {
    font-size: 3rem;
    color: var(--accent-color);
}

.login-logo h2 {
    margin-top: 0.75rem;
    color: var(--text-primary);
    font-weight: 800;
    letter-spacing: -0.03em;
}

/* ─── Animations ────────────────────────────────────────────────────────── */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.fade-in {
    animation: fadeIn 0.3s ease-out;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.pulse {
    animation: pulse 2s ease-in-out infinite;
}

/* ─── Nav Tabs ──────────────────────────────────────────────────────────── */
.nav-tabs {
    border-bottom: 2px solid var(--border-color);
    gap: 0.25rem;
}

.nav-tabs .nav-link {
    border: none;
    color: var(--text-secondary);
    font-weight: 600;
    padding: 0.75rem 1.25rem;
    border-radius: var(--border-radius-sm) var(--border-radius-sm) 0 0;
    position: relative;
    font-size: 0.875rem;
    transition: var(--transition-fast);
}

.nav-tabs .nav-link:hover {
    color: var(--accent-color);
    background: var(--accent-subtle);
}

.nav-tabs .nav-link.active {
    color: var(--accent-color);
    background: var(--white);
    border-bottom: 2px solid var(--accent-color);
    margin-bottom: -2px;
}

/* ─── Responsive: Tablet & Laptop ───────────────────────────────────────── */
@media (max-width: 991.98px) {
    .sidebar {
        position: fixed;
        left: -280px;
        top: 64px;
        width: 280px;
        height: calc(100vh - 64px);
        transition: var(--transition-normal);
        z-index: 1020;
        overflow-y: auto;
    }

    .sidebar.show {
        left: 0;
    }

    .sidebar-overlay {
        display: none;
        position: fixed;
        top: 64px;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(0, 0, 0, 0.4);
        backdrop-filter: blur(2px);
        z-index: 1015;
    }

    .sidebar-overlay.show {
        display: block;
    }

    .content-wrapper {
        padding: 1rem;
    }

    .page-header {
        flex-direction: column;
        align-items: flex-start;
    }

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

    .stat-card .stat-content h3,
    .stat-card .stat-value {
        font-size: 1.25rem;
    }

    .stat-card .stat-icon {
        width: 48px;
        height: 48px;
        min-width: 48px;
        font-size: 1.25rem;
    }

    .card-body {
        padding: 1rem;
    }

    .table-responsive {
        font-size: 0.875rem;
    }

    .btn {
        padding: 0.5rem 1rem;
    }

    .modal-dialog {
        margin: 0.5rem;
    }

    .modal-body {
        padding: 1rem;
    }
}

/* ─── Responsive: Phone ─────────────────────────────────────────────────── */
@media (max-width: 575.98px) {
    .navbar-brand {
        font-size: 1rem;
    }

    .stat-card {
        margin-bottom: 0.75rem;
    }

    .btn-group-mobile {
        display: flex;
        flex-direction: column;
        gap: 0.5rem;
    }

    .btn-group-mobile .btn {
        width: 100%;
    }

    .page-header .btn {
        width: 100%;
    }

    .dt-mobile-controls .dataTables_filter input {
        width: 100% !important;
        margin-left: 0 !important;
    }

    .btn,
    .nav-link,
    .dropdown-item,
    .page-link {
        min-height: 44px;
        display: flex;
        align-items: center;
    }

    .sidebar .nav-link {
        min-height: 44px;
    }
}

@media (max-width: 768px) {
    .mobile-only {
        display: block;
    }

    .mobile-hide {
        display: none !important;
    }

    body {
        padding-bottom: 72px;
    }

    /* Mobile card layout for tables */
    table.table-card thead {
        display: none;
    }

    table.table-card tbody tr {
        display: block;
        margin-bottom: 0.75rem;
        border: 1px solid var(--border-color);
        border-radius: var(--border-radius-md);
        padding: 0.5rem 0.75rem;
        background: var(--white);
        box-shadow: var(--shadow-xs);
    }

    table.table-card tbody td {
        display: flex;
        justify-content: space-between;
        gap: 0.75rem;
        padding: 0.5rem 0;
        border: none;
        align-items: flex-start;
    }

    table.table-card tbody td::before {
        content: attr(data-label);
        font-weight: 600;
        color: var(--text-muted);
        min-width: 40%;
        text-align: left;
        font-size: 0.8rem;
    }

    table.table-card tbody td.text-end,
    table.table-card tbody td.text-center {
        text-align: left !important;
    }

    table.table-card tbody td.dt-actions {
        padding-top: 0.75rem;
    }

    table.table-card tbody td.dt-actions::before {
        content: "İşlemler";
    }

    table.table-card tbody td.dt-actions .btn,
    table.table-card tbody td.dt-actions .dropdown-toggle {
        width: 100%;
    }

    table.table-card tbody td.dt-actions {
        flex-wrap: wrap;
        gap: 0.35rem;
    }

    table.table-card tbody td.dt-actions .btn-group {
        width: 100%;
        display: flex;
    }

    table.table-card tbody td.dt-actions .btn-group .btn {
        flex: 1;
    }

    .modal-dialog {
        margin: 0;
        max-width: 100%;
        height: 100%;
    }

    .modal-content {
        height: 100%;
        border-radius: 0;
        display: flex;
        flex-direction: column;
    }

    .modal-body {
        flex: 1 1 auto;
        overflow-y: auto;
    }

    .modal-footer {
        flex-wrap: wrap;
        gap: 0.5rem;
    }

    .modal-footer .btn {
        flex: 1 1 100%;
        width: 100%;
    }

    form .row > [class^="col-"],
    form .row > [class*=" col-"] {
        flex: 0 0 100%;
        max-width: 100%;
    }

    form .input-group,
    form .form-control,
    form .form-select {
        width: 100%;
    }

    .dt-mobile-controls {
        margin-bottom: 0.75rem;
        flex-wrap: nowrap;
    }

    .dataTables_wrapper .dataTables_filter input {
        min-width: 160px;
    }

    .dt-mobile-controls .dataTables_filter {
        justify-content: flex-start;
        display: flex;
        align-items: center;
        flex-wrap: nowrap;
    }

    .dt-mobile-controls .dataTables_filter label {
        width: auto;
        justify-content: flex-start;
        display: flex;
        align-items: center;
        gap: 0.5rem;
    }

    .dt-mobile-controls .dataTables_filter input {
        min-width: 160px;
        width: auto;
    }

    .dt-mobile-filter,
    .dt-mobile-paginate {
        display: flex;
        align-items: center;
        flex-wrap: nowrap;
    }

    .dt-mobile-paginate {
        justify-content: flex-end;
        overflow-x: auto;
    }

    .dt-mobile-controls .dataTables_paginate {
        display: flex;
        justify-content: flex-end;
        width: 100%;
    }

    .dt-mobile-controls .dataTables_paginate .pagination {
        flex-wrap: nowrap;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        gap: 0.25rem;
        margin-bottom: 0;
        width: max-content;
    }

    .dt-mobile-controls .dataTables_paginate .pagination::-webkit-scrollbar {
        height: 4px;
    }

    .dt-mobile-controls .dataTables_paginate .paginate_button {
        min-width: 44px;
        min-height: 44px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }

    .dataTables_wrapper .page-link {
        padding: 0.4rem 0.6rem;
        white-space: nowrap;
    }
}

@media (min-width: 769px) {
    .mobile-only {
        display: none;
    }
}

/* ─── Print ─────────────────────────────────────────────────────────────── */
@media print {
    .navbar,
    .sidebar,
    .btn,
    .no-print,
    .mobile-bottom-nav,
    .fab-container,
    .dt-top,
    .dt-bottom,
    .filter-card,
    .offcanvas,
    .offcanvas-backdrop,
    .alert {
        display: none !important;
    }

    .content-wrapper {
        padding: 0;
        margin: 0;
    }

    body {
        font-size: 12pt;
        color: #000;
        background: #fff;
    }

    .card {
        box-shadow: none;
        border: 1px solid #ddd;
        page-break-inside: avoid;
    }

    table {
        width: 100% !important;
        font-size: 10pt;
    }

    table th, table td {
        padding: 4px 6px !important;
    }

    .receipt-preview {
        border: none;
        padding: 0;
    }

    a[href]::after {
        content: none !important;
    }
}

/* ─── Utilities ─────────────────────────────────────────────────────────── */
.cursor-pointer { cursor: pointer; }
.fw-medium { font-weight: 500; }
.text-truncate-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* ─── FAB (Floating Action Button) ──────────────────────────────────────── */
.fab-container {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    z-index: 1000;
}

.fab-btn {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    box-shadow: var(--shadow-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
}

.fab-menu {
    position: absolute;
    bottom: 70px;
    right: 0;
    display: none;
}

.fab-container:hover .fab-menu,
.fab-container.active .fab-menu {
    display: block;
}

.fab-menu-item {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    margin-bottom: 0.75rem;
    opacity: 0;
    transform: translateY(20px);
    animation: fadeIn 0.2s ease-out forwards;
}

.fab-menu-item:nth-child(1) { animation-delay: 0.05s; }
.fab-menu-item:nth-child(2) { animation-delay: 0.1s; }
.fab-menu-item:nth-child(3) { animation-delay: 0.15s; }

.fab-menu-item span {
    background: var(--primary-color);
    color: #fff;
    padding: 0.5rem 1rem;
    border-radius: var(--border-radius-sm);
    margin-right: 0.75rem;
    white-space: nowrap;
    font-size: 0.875rem;
    box-shadow: var(--shadow-md);
}

.fab-menu-item .btn {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    padding: 0;
}

/* ─── Touch Friendly ────────────────────────────────────────────────────── */
@media (hover: none) and (pointer: coarse) {
    .btn {
        min-height: 44px;
    }

    .nav-link {
        min-height: 48px;
    }

    .form-control,
    .form-select {
        min-height: 48px;
        font-size: 16px; /* Prevents zoom on iOS */
    }

    .dropdown-item {
        padding: 0.75rem 1rem;
    }
}

/* ─── Global Search Results ─────────────────────────────────────────────── */
.search-result-item {
    transition: var(--transition-fast);
}

.search-result-item:hover {
    background-color: var(--accent-subtle) !important;
}

/* ─── Scrollbar ─────────────────────────────────────────────────────────── */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

/* ─── Form Check / Switch Enhancements ──────────────────────────────────── */
.form-check-input:checked {
    background-color: var(--accent-color);
    border-color: var(--accent-color);
}

.form-check-input:focus {
    box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.1);
    border-color: var(--accent-color);
}

.form-switch .form-check-input {
    border-radius: var(--border-radius-full);
}

/* ─── Chart Container ───────────────────────────────────────────────────── */
canvas {
    border-radius: var(--border-radius-md);
}

/* Chart container sizes */
.chart-container-sm {
    position: relative;
    width: 100%;
    max-width: 360px;
    height: 300px;
    margin: 0 auto;
}
.chart-container-lg {
    position: relative;
    width: 100%;
    height: 320px;
}
.chart-container-xl {
    position: relative;
    width: 100%;
    height: 1280px;
    max-height: 80vh;
}

@media (max-width: 768px) {
    .chart-container-sm {
        max-width: 280px;
        height: 250px;
    }
    .chart-container-lg {
        height: 260px;
    }
    .chart-container-xl {
        height: 800px;
        max-height: 70vh;
    }
}

/* Chart card hover */
.card.shadow-sm {
    transition: box-shadow 0.25s ease, transform 0.25s ease;
}
.card.shadow-sm:hover {
    box-shadow: 0 6px 24px rgba(0, 0, 0, 0.1) !important;
    transform: translateY(-2px);
}
