:root {
    --primary: #1a4a7a;
    --primary-light: #2563a8;
    --primary-dark: #0f2d4e;
    --accent: #2196F3;
    --accent-light: #64b5f6;
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    --info: #06b6d4;
    --bg: #f0f4f8;
    --bg-card: #ffffff;
    --sidebar-bg: linear-gradient(180deg, #0f2d4e 0%, #1a4a7a 60%, #1e5490 100%);
    --sidebar-width: 260px;
    --header-height: 64px;
    --text: #1e293b;
    --text-muted: #64748b;
    --text-light: #94a3b8;
    --border: #e2e8f0;
    --shadow: 0 1px 3px rgba(0,0,0,.1), 0 1px 2px rgba(0,0,0,.06);
    --shadow-md: 0 4px 6px -1px rgba(0,0,0,.1), 0 2px 4px -1px rgba(0,0,0,.06);
    --shadow-lg: 0 10px 15px -3px rgba(0,0,0,.1), 0 4px 6px -2px rgba(0,0,0,.05);
    --radius: 10px;
    --radius-sm: 6px;
    --transition: 0.2s ease;
    --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

/* ============================================================
   RESET & BASE
   ============================================================ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
    font-family: var(--font);
    background: var(--bg);
    color: var(--text);
    font-size: 14px;
    line-height: 1.6;
    min-height: 100vh;
}

a { color: var(--primary); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--primary-light); }

img { max-width: 100%; }

/* ============================================================
   LOGIN PAGE
   ============================================================ */
.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--sidebar-bg);
    padding: 20px;
}

.login-card {
    background: #fff;
    border-radius: 16px;
    padding: 48px 40px;
    width: 100%;
    max-width: 420px;
    box-shadow: var(--shadow-lg);
    animation: slideUp .4s ease;
}

.login-logo {
    text-align: center;
    margin-bottom: 32px;
}

.login-logo img {
    height: 60px;
    object-fit: contain;
}

.login-logo svg {
    height: 60px;
}

.login-title {
    text-align: center;
    margin-bottom: 32px;
}

.login-title h1 {
    font-size: 22px;
    font-weight: 700;
    color: var(--primary);
}

.login-title p {
    font-size: 13px;
    color: var(--text-muted);
    margin-top: 4px;
}

/* ============================================================
   FORMS
   ============================================================ */
.form-group {
    margin-bottom: 16px;
}

.form-label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 6px;
}

.form-control {
    width: 100%;
    padding: 10px 14px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    font-family: var(--font);
    font-size: 14px;
    color: var(--text);
    background: #fff;
    transition: border-color var(--transition), box-shadow var(--transition);
    outline: none;
}

.form-control:focus {
    border-color: var(--primary-light);
    box-shadow: 0 0 0 3px rgba(37,99,168,.15);
}

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

select.form-control { cursor: pointer; }

textarea.form-control { resize: vertical; min-height: 80px; }

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.form-row-3 {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 12px;
}

.form-hint {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 4px;
}

/* ============================================================
   BUTTONS
   ============================================================ */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 9px 18px;
    border-radius: var(--radius-sm);
    font-family: var(--font);
    font-size: 14px;
    font-weight: 600;
    border: none;
    cursor: pointer;
    transition: all var(--transition);
    white-space: nowrap;
}

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

.btn-accent {
    background: var(--accent);
    color: #fff;
}
.btn-accent:hover { background: #1e88e5; color: #fff; }

.btn-success {
    background: var(--success);
    color: #fff;
}
.btn-success:hover { background: #059669; color: #fff; }

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

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

.btn-secondary {
    background: #f1f5f9;
    color: var(--text);
    border: 1px solid var(--border);
}
.btn-secondary:hover { background: #e2e8f0; }

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

.btn-sm { padding: 6px 12px; font-size: 12px; }
.btn-lg { padding: 13px 28px; font-size: 16px; width: 100%; justify-content: center; }
.btn-icon { padding: 8px; border-radius: var(--radius-sm); }
.btn-icon svg { width: 16px; height: 16px; }

/* ============================================================
   LAYOUT
   ============================================================ */
.app-wrapper {
    display: flex;
    min-height: 100vh;
}

/* ============================================================
   SIDEBAR
   ============================================================ */
.sidebar {
    width: var(--sidebar-width);
    background: var(--sidebar-bg);
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    display: flex;
    flex-direction: column;
    z-index: 100;
    transition: transform var(--transition);
    overflow-y: auto;
    overflow-x: hidden;
}

.sidebar-logo {
    padding: 20px 20px 16px;
    border-bottom: 1px solid rgba(255,255,255,.1);
}

.sidebar-logo img {
    height: 88px;
    object-fit: contain;
}

.sidebar-logo-svg {
    display: flex;
    align-items: center;
    gap: 10px;
}

.sidebar-logo-text {
    color: #fff;
    font-size: 15px;
    font-weight: 700;
    line-height: 1.2;
}

.sidebar-logo-text span {
    font-size: 11px;
    color: rgba(255,255,255,.6);
    font-weight: 400;
    display: block;
}

.sidebar-user {
    padding: 14px 20px;
    border-bottom: 1px solid rgba(255,255,255,.1);
    display: flex;
    align-items: center;
    gap: 10px;
}

.sidebar-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(255,255,255,.2);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 700;
    color: #fff;
    flex-shrink: 0;
}

.sidebar-user-info {
    min-width: 0;
}

.sidebar-user-name {
    color: #fff;
    font-size: 13px;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sidebar-user-role {
    color: rgba(255,255,255,.55);
    font-size: 11px;
}

.sidebar-nav {
    flex: 1;
    padding: 10px 0;
}

.sidebar-section {
    padding: 12px 14px 4px;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .08em;
    color: rgba(255,255,255,.35);
}

.sidebar-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 14px 9px 16px;
    color: rgba(255,255,255,.75);
    font-size: 13.5px;
    font-weight: 500;
    border-radius: 0;
    transition: all var(--transition);
    position: relative;
    margin: 1px 8px;
    border-radius: 8px;
}

.sidebar-item:hover {
    color: #fff;
    background: rgba(255,255,255,.12);
}

.sidebar-item.active {
    color: #fff;
    background: rgba(255,255,255,.18);
    font-weight: 600;
}

.sidebar-item.active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 4px;
    bottom: 4px;
    width: 3px;
    background: var(--accent-light);
    border-radius: 0 3px 3px 0;
}

.sidebar-item svg {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
    opacity: .8;
}

.sidebar-item.active svg,
.sidebar-item:hover svg { opacity: 1; }

.sidebar-item .badge {
    margin-left: auto;
    background: var(--danger);
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    padding: 2px 7px;
    border-radius: 20px;
}

.sidebar-footer {
    padding: 12px 8px;
    border-top: 1px solid rgba(255,255,255,.1);
}

/* ============================================================
   MAIN CONTENT
   ============================================================ */
.main-content {
    margin-left: var(--sidebar-width);
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* ============================================================
   TOP HEADER
   ============================================================ */
.top-header {
    height: var(--header-height);
    background: #fff;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    position: sticky;
    top: 0;
    z-index: 50;
    gap: 16px;
}

.header-title {
    font-size: 18px;
    font-weight: 700;
    color: var(--primary);
    flex: 1;
}

.header-subtitle {
    font-size: 12px;
    color: var(--text-muted);
    font-weight: 400;
}

.hamburger {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
}

.hamburger span {
    display: block;
    width: 22px;
    height: 2px;
    background: var(--text);
    border-radius: 2px;
    transition: all var(--transition);
}

/* ============================================================
   PAGE CONTENT
   ============================================================ */
.page-body {
    padding: 24px;
    flex: 1;
}

/* ============================================================
   CARDS
   ============================================================ */
.card {
    background: var(--bg-card);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow: hidden;
}

.card-header {
    padding: 16px 20px;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.card-title {
    font-size: 15px;
    font-weight: 700;
    color: var(--primary);
    display: flex;
    align-items: center;
    gap: 8px;
}

.card-title svg {
    width: 18px;
    height: 18px;
    color: var(--primary-light);
}

.card-body {
    padding: 20px;
}

.card-body-flush { padding: 0; }

.card-footer {
    padding: 12px 20px;
    border-top: 1px solid var(--border);
    background: #fafbfc;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

/* ============================================================
   STAT CARDS (Dashboard)
   ============================================================ */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.stat-card {
    background: var(--bg-card);
    border-radius: var(--radius);
    padding: 20px;
    box-shadow: var(--shadow);
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    transition: transform var(--transition), box-shadow var(--transition);
}

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

.stat-card-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.stat-card-icon svg {
    width: 24px;
    height: 24px;
    color: #fff;
}

.icon-blue { background: linear-gradient(135deg, #1a4a7a, #2563a8); }
.icon-green { background: linear-gradient(135deg, #059669, #10b981); }
.icon-orange { background: linear-gradient(135deg, #d97706, #f59e0b); }
.icon-red { background: linear-gradient(135deg, #dc2626, #ef4444); }
.icon-purple { background: linear-gradient(135deg, #7c3aed, #a78bfa); }
.icon-teal { background: linear-gradient(135deg, #0891b2, #06b6d4); }

.stat-card-info {}

.stat-card-value {
    font-size: 22px;
    font-weight: 800;
    color: var(--text);
    line-height: 1.2;
}

.stat-card-label {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 2px;
}

.stat-card-change {
    font-size: 12px;
    font-weight: 600;
    margin-top: 4px;
}

.stat-card-change.up { color: var(--success); }
.stat-card-change.down { color: var(--danger); }

/* ============================================================
   TABLE
   ============================================================ */
/* ============================================================
   TABLE & DATA-TABLE (Modern & Ferah Satır/Sütun Tasarımı)
   ============================================================ */
.table-wrapper, .table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    width: 100%;
}

table, .table, .data-table {
    width: 100% !important;
    min-width: 1000px;
    border-collapse: separate;
    border-spacing: 0;
    text-align: left;
}

table th, .table th, .data-table th {
    background: #f8fafc;
    padding: 16px 20px;
    font-size: 13px;
    font-weight: 700;
    color: #334155;
    text-transform: uppercase;
    letter-spacing: .03em;
    border-bottom: 2px solid var(--border);
    white-space: nowrap;
    vertical-align: middle;
}

table td, .table td, .data-table td {
    padding: 16px 20px;
    border-bottom: 1px solid #edf2f7;
    font-size: 14px;
    line-height: 1.5;
    vertical-align: middle;
    color: var(--text);
    transition: background 0.15s ease;
}

table tbody tr:hover td, .table tbody tr:hover td, .data-table tbody tr:hover td {
    background: #f8fafc;
}

table tfoot td, .table tfoot td, .data-table tfoot td {
    padding: 16px 20px;
    font-weight: 700;
    border-top: 2px solid var(--border);
    background: #fdfdfd;
}

/* Tablo Ürün ve Cari Resim Alanları (Geniş & Net Görünüm) */
.table-thumb {
    width: 58px;
    height: 58px;
    border-radius: 8px;
    object-fit: cover;
    border: 1px solid var(--border);
    flex-shrink: 0;
    background: #fff;
    box-shadow: 0 2px 5px rgba(0,0,0,0.06);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.table-thumb:hover {
    transform: scale(1.2);
    z-index: 10;
    position: relative;
    box-shadow: 0 6px 16px rgba(0,0,0,0.18);
}
.table-thumb-placeholder {
    width: 58px;
    height: 58px;
    border-radius: 8px;
    background: var(--bg);
    border: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    font-size: 18px;
    font-weight: 700;
    flex-shrink: 0;
}

table td.text-right, table th.text-right,
.table td.text-right, .table th.text-right,
.data-table td.text-right, .data-table th.text-right {
    text-align: right !important;
}

table td.text-center, table th.text-center,
.table td.text-center, .table th.text-center,
.data-table td.text-center, .data-table th.text-center {
    text-align: center !important;
}

/* Tablo Araç Çubuğu (Arama, Excel, PDF) */
.table-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 16px;
}

.export-btns {
    display: inline-flex;
    gap: 8px;
    align-items: center;
}

.btn-export {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 14px;
    font-size: 12.5px;
    font-weight: 600;
    border-radius: 6px;
    border: 1px solid var(--border);
    background: #ffffff;
    color: var(--text);
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 1px 2px rgba(0,0,0,0.05);
}

.btn-export:hover {
    background: #f8fafc;
    border-color: #cbd5e1;
    color: var(--primary);
    transform: translateY(-1px);
}

.btn-export-excel:hover {
    color: #15803d;
    border-color: #86efac;
    background: #f0fdf4;
}

.btn-export-pdf:hover {
    color: #b91c1c;
    border-color: #fca5a5;
    background: #fef2f2;
}

@media print {
    .sidebar, .top-header, .btn, .table-toolbar, form, .modal, .sticky-board {
        display: none !important;
    }
    .main-content {
        margin-left: 0 !important;
        padding: 0 !important;
    }
    .page-body {
        padding: 0 !important;
    }
    .card {
        box-shadow: none !important;
        border: none !important;
    }
    table, .table {
        width: 100% !important;
        border-collapse: collapse !important;
    }
    table th, table td {
        padding: 8px 10px !important;
        font-size: 11px !important;
        border: 1px solid #e2e8f0 !important;
    }
}

/* ============================================================
   BADGES & STATUS
   ============================================================ */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 700;
    white-space: nowrap;
}

.badge-success { background: #dcfce7; color: #166534; }
.badge-danger  { background: #fee2e2; color: #991b1b; }
.badge-warning { background: #fef9c3; color: #854d0e; }
.badge-info    { background: #e0f2fe; color: #075985; }
.badge-purple  { background: #ede9fe; color: #4c1d95; }
.badge-default { background: #f1f5f9; color: #475569; }
.badge-primary { background: #dbeafe; color: #1e3a5f; }

/* ============================================================
   ALERTS
   ============================================================ */
.alert {
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    font-size: 13.5px;
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin-bottom: 16px;
}

.alert-success { background: #dcfce7; color: #166534; border-left: 4px solid var(--success); }
.alert-danger  { background: #fee2e2; color: #991b1b; border-left: 4px solid var(--danger); }
.alert-warning { background: #fef9c3; color: #854d0e; border-left: 4px solid var(--warning); }
.alert-info    { background: #e0f2fe; color: #075985; border-left: 4px solid var(--info); }

/* ============================================================
   PAGINATION
   ============================================================ */
.pagination {
    display: flex;
    align-items: center;
    gap: 4px;
    flex-wrap: wrap;
}

.page-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: var(--radius-sm);
    font-size: 13px;
    font-weight: 600;
    color: var(--text-muted);
    background: #fff;
    border: 1px solid var(--border);
    transition: all var(--transition);
}

.page-link:hover,
.page-link.active {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
}

/* ============================================================
   MODAL
   ============================================================ */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.5);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    opacity: 0;
    pointer-events: none;
    transition: opacity var(--transition);
}

.modal-overlay.open {
    opacity: 1;
    pointer-events: all;
}

.modal {
    background: #fff;
    border-radius: var(--radius);
    width: 100%;
    max-width: 560px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: var(--shadow-lg);
    transform: scale(.96);
    transition: transform var(--transition);
}

.modal-overlay.open .modal { transform: scale(1); }

.modal-header {
    padding: 18px 20px;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.modal-title { font-size: 16px; font-weight: 700; color: var(--primary); }

.modal-close {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-muted);
    font-size: 20px;
    line-height: 1;
    padding: 0 2px;
    transition: color var(--transition);
}
.modal-close:hover { color: var(--danger); }

.modal-body { padding: 20px; }

.modal-footer {
    padding: 14px 20px;
    border-top: 1px solid var(--border);
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

/* ============================================================
   GRID LAYOUTS
   ============================================================ */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 20px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; }

/* ============================================================
   UTILITY
   ============================================================ */
.text-right { text-align: right; }
.text-center { text-align: center; }
.text-muted { color: var(--text-muted); }
.text-success { color: var(--success); }
.text-danger { color: var(--danger); }
.text-warning { color: var(--warning); }
.text-primary { color: var(--primary); }
.text-bold { font-weight: 700; }
.text-sm { font-size: 12px; }

.mb-0 { margin-bottom: 0; }
.mb-1 { margin-bottom: 8px; }
.mb-2 { margin-bottom: 16px; }
.mb-3 { margin-bottom: 24px; }
.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }

.flex { display: flex; align-items: center; }
.flex-between { display: flex; align-items: center; justify-content: space-between; }
.gap-1 { gap: 8px; }
.gap-2 { gap: 12px; }
.gap-3 { gap: 16px; }

.separator { height: 1px; background: var(--border); margin: 16px 0; }

.empty-state {
    text-align: center;
    padding: 48px 20px;
    color: var(--text-muted);
}

.empty-state svg {
    width: 48px;
    height: 48px;
    opacity: .3;
    margin-bottom: 12px;
}

.empty-state p { font-size: 14px; }

/* ============================================================
   SEARCH BAR
   ============================================================ */
.search-bar {
    position: relative;
    flex: 1;
    max-width: 320px;
}

.search-bar svg {
    position: absolute;
    left: 10px;
    top: 50%;
    transform: translateY(-50%);
    width: 16px;
    height: 16px;
    color: var(--text-muted);
}

.search-bar input {
    padding-left: 34px;
}

/* ============================================================
   POS SCREEN
   ============================================================ */
.pos-wrapper {
    display: grid;
    grid-template-columns: 1fr 380px;
    gap: 0;
    height: calc(100vh - var(--header-height));
    overflow: hidden;
}

.pos-products {
    padding: 16px;
    overflow-y: auto;
    background: var(--bg);
}

.pos-search {
    margin-bottom: 12px;
}

.pos-search input {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid var(--border);
    border-radius: var(--radius);
    font-size: 16px;
    outline: none;
    transition: border-color var(--transition);
}

.pos-search input:focus {
    border-color: var(--primary-light);
}

.pos-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 10px;
}

.pos-product-card {
    background: #fff;
    border-radius: var(--radius);
    padding: 14px 12px;
    cursor: pointer;
    transition: all var(--transition);
    border: 2px solid transparent;
    text-align: center;
    user-select: none;
}

.pos-product-card:hover {
    border-color: var(--primary-light);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.pos-product-card:active {
    transform: scale(.97);
}

.pos-product-name {
    font-size: 13px;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 6px;
    line-height: 1.3;
}

.pos-product-price {
    font-size: 15px;
    font-weight: 800;
    color: var(--primary);
}

.pos-product-stock {
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 4px;
}

.pos-cart {
    background: #fff;
    border-left: 1px solid var(--border);
    display: flex;
    flex-direction: column;
}

.pos-cart-header {
    padding: 14px 16px;
    border-bottom: 1px solid var(--border);
    font-weight: 700;
    color: var(--primary);
    font-size: 15px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.pos-cart-items {
    flex: 1;
    overflow-y: auto;
    padding: 8px;
}

.pos-cart-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px;
    border-radius: var(--radius-sm);
    margin-bottom: 4px;
    background: #f8fafc;
}

.pos-cart-item-name {
    flex: 1;
    font-size: 13px;
    font-weight: 600;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.pos-qty-control {
    display: flex;
    align-items: center;
    gap: 4px;
}

.pos-qty-btn {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    border: 1.5px solid var(--border);
    background: #fff;
    cursor: pointer;
    font-size: 14px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition);
}

.pos-qty-btn:hover {
    border-color: var(--primary);
    color: var(--primary);
}

.pos-qty { font-size: 13px; font-weight: 700; min-width: 24px; text-align: center; }

.pos-item-price {
    font-size: 13px;
    font-weight: 700;
    color: var(--primary);
    white-space: nowrap;
}

.pos-item-remove {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 2px;
    transition: color var(--transition);
}

.pos-item-remove:hover { color: var(--danger); }

.pos-cart-totals {
    padding: 12px 16px;
    border-top: 1px solid var(--border);
    background: #f8fafc;
}

.pos-total-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 4px;
    font-size: 13px;
}

.pos-total-row.grand {
    font-size: 20px;
    font-weight: 800;
    color: var(--primary);
    margin-top: 8px;
    padding-top: 8px;
    border-top: 2px solid var(--border);
}

.pos-payment {
    padding: 12px 16px;
    border-top: 1px solid var(--border);
}

.pos-payment-btns {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin-bottom: 8px;
}

.pos-complete-btn {
    width: 100%;
    padding: 14px;
    background: linear-gradient(135deg, var(--success), #059669);
    color: #fff;
    border: none;
    border-radius: var(--radius);
    font-size: 16px;
    font-weight: 800;
    cursor: pointer;
    transition: all var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

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

.pos-complete-btn:disabled {
    opacity: .5;
    cursor: not-allowed;
    transform: none;
}

/* ============================================================
   INVOICE PRINT
   ============================================================ */
@media print {
    .sidebar, .top-header, .no-print { display: none !important; }
    .main-content { margin-left: 0 !important; }
    .print-area { display: block !important; }
    body { background: #fff; font-size: 12px; }
}

/* ============================================================
   CHART CONTAINERS
   ============================================================ */
.chart-container {
    position: relative;
    height: 260px;
}

/* ============================================================
   PROGRESS BAR
   ============================================================ */
.progress-bar {
    height: 6px;
    border-radius: 20px;
    background: #e2e8f0;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    border-radius: 20px;
    background: linear-gradient(90deg, var(--primary), var(--accent));
    transition: width .6s ease;
}

/* ============================================================
   ANIMATIONS
   ============================================================ */
@keyframes slideUp {
    from { opacity: 0; transform: translateY(20px); }
    to   { opacity: 1; transform: translateY(0); }
}

@keyframes fadeIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.animate-spin {
    animation: spin 1s linear infinite;
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 1024px) {
    .grid-4 { grid-template-columns: repeat(2, 1fr); }
    .pos-wrapper { grid-template-columns: 1fr 340px; }
}

@media (max-width: 768px) {
    :root {
        --sidebar-width: 0px;
    }

    .sidebar {
        width: 260px;
        transform: translateX(-100%);
    }

    .sidebar.open {
        transform: translateX(0);
        box-shadow: var(--shadow-lg);
    }

    .sidebar-overlay {
        position: fixed;
        inset: 0;
        background: rgba(0,0,0,.4);
        z-index: 99;
        display: none;
    }

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

    .main-content { margin-left: 0; }

    .hamburger { display: flex; }

    .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }

    .form-row, .form-row-3 { grid-template-columns: 1fr; }

    .stats-grid { grid-template-columns: 1fr 1fr; }

    .page-body { padding: 16px; }

    .pos-wrapper {
        grid-template-columns: 1fr;
        grid-template-rows: 1fr auto;
        height: auto;
    }

    .pos-cart {
        max-height: 50vh;
    }

    .pos-grid {
        grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
    }
}

@media (max-width: 480px) {
    .stats-grid { grid-template-columns: 1fr; }
    .card-header { flex-direction: column; align-items: flex-start; }
    .top-header { padding: 0 16px; }
    .page-body { padding: 12px; }
}

/* ============================================================
   MODALS & DIALOGS
   ============================================================ */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(4px);
    z-index: 1000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
    animation: fadeIn .2s ease;
}

.modal.active, .modal.show {
    display: flex !important;
}

.modal .card {
    background: #ffffff;
    border-radius: 14px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    max-height: 90vh;
    overflow-y: auto;
    animation: slideUp .25s ease;
}

/* ============================================================
   BADGES & UTILITIES
   ============================================================ */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 3px 8px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.3px;
}
.badge-primary { background: #e0f2fe; color: #0284c7; }
.badge-success { background: #dcfce7; color: #16a34a; }
.badge-danger  { background: #fee2e2; color: #dc2626; }
.badge-warning { background: #fef3c7; color: #d97706; }
.badge-info    { background: #e0e7ff; color: #4f46e5; }
.badge-default { background: #f1f5f9; color: #475569; }

.text-right { text-align: right !important; }
.text-center { text-align: center !important; }
.text-left { text-align: left !important; }

/* ============================================================
   STICKY NOTES (YAPIŞKAN NOTLAR)
   ============================================================ */
.sticky-board {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
    gap: 16px;
    margin-top: 14px;
}
.sticky-note {
    position: relative;
    padding: 16px 18px;
    border-radius: 8px;
    box-shadow: 0 4px 6px -1px rgba(0,0,0,0.08), 0 2px 4px -2px rgba(0,0,0,0.05);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-height: 140px;
    border-top: 5px solid rgba(0,0,0,0.15);
}
.sticky-note:hover {
    transform: translateY(-3px) rotate(0.5deg);
    box-shadow: 0 10px 15px -3px rgba(0,0,0,0.12);
}
.sticky-note .note-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 8px;
}
.sticky-note .note-title {
    font-weight: 700;
    font-size: 14px;
    line-height: 1.3;
}
.sticky-note .note-close {
    background: transparent;
    border: none;
    cursor: pointer;
    font-size: 18px;
    line-height: 1;
    opacity: 0.5;
    transition: opacity 0.2s;
    padding: 0 2px;
}
.sticky-note .note-close:hover {
    opacity: 1;
    color: #ef4444;
}
.sticky-note .note-body {
    font-size: 13px;
    line-height: 1.5;
    flex: 1;
    white-space: pre-wrap;
    word-break: break-word;
}
.sticky-note .note-footer {
    margin-top: 12px;
    font-size: 11px;
    opacity: 0.65;
    text-align: right;
}

.sticky-note.sari { background-color: #fef08a; color: #713f12; border-color: #eab308; }
.sticky-note.mavi { background-color: #bae6fd; color: #075985; border-color: #38bdf8; }
.sticky-note.yesil { background-color: #bbf7d0; color: #14532d; border-color: #4ade80; }
.sticky-note.pembe { background-color: #fbcfe8; color: #831843; border-color: #f472b6; }
.sticky-note.mor { background-color: #e9d5ff; color: #581c87; border-color: #c084fc; }
.sticky-note.turuncu { background-color: #fed7aa; color: #7c2d12; border-color: #fb923c; }

.color-picker-opt {
    display: inline-block;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    cursor: pointer;
    border: 2px solid transparent;
    transition: transform 0.2s;
}
.color-picker-opt:hover {
    transform: scale(1.15);
}
.color-picker-opt.selected {
    border-color: #0f172a;
    box-shadow: 0 0 0 2px rgba(0,0,0,0.25);
}

/* ============================================================
   MOBİL RESPONSIVE — @media max-width: 900px
   ============================================================ */
@media (max-width: 900px) {
    :root {
        --sidebar-width: 260px;
    }

    /* Hamburger göster */
    .hamburger {
        display: flex !important;
    }

    /* Sidebar gizle, overlay ile aç */
    .sidebar {
        transform: translateX(-100%);
        transition: transform 0.28s cubic-bezier(.4,0,.2,1);
        z-index: 200;
    }
    .sidebar.open {
        transform: translateX(0);
    }

    /* Sidebar overlay */
    .sidebar-overlay {
        display: none;
        position: fixed;
        inset: 0;
        background: rgba(0,0,0,0.5);
        z-index: 199;
    }
    .sidebar-overlay.active {
        display: block;
    }

    /* Main content tam genişlik */
    .main-content {
        margin-left: 0 !important;
    }

    /* Top header kompakt */
    .top-header {
        padding: 0 12px;
        gap: 8px;
    }

    /* Kullanıcı kutusunu mobilde gizle (isim kısmı) */
    .top-header [style*="max-width:120px"] {
        max-width: 80px !important;
    }

    /* Page body */
    .page-body {
        padding: 12px !important;
    }

    /* Stats grid — tek sütun */
    .stats-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 10px;
    }

    /* Tüm grid'leri tek sütun yap */
    [style*="grid-template-columns"],
    .form-grid,
    .two-col,
    .three-col {
        grid-template-columns: 1fr !important;
    }

    /* Tablolar yatay scroll */
    .table-wrapper,
    .table-responsive {
        overflow-x: auto !important;
        -webkit-overflow-scrolling: touch;
    }

    /* Kart */
    .card-body {
        padding: 12px !important;
    }

    /* Footer */
    .page-footer {
        flex-direction: column !important;
        gap: 10px !important;
        padding: 12px !important;
        text-align: center;
    }

    /* Header title font küçük */
    .header-title {
        font-size: 15px !important;
    }

    /* POS grid */
    .pos-grid {
        grid-template-columns: 1fr !important;
    }

    /* Modal tam ekran */
    .modal-content {
        width: 95vw !important;
        max-width: 95vw !important;
        margin: 10px !important;
        max-height: 92vh;
        overflow-y: auto;
    }

    /* Fatura kalem tablosu */
    #faturaForm .table-responsive,
    #itemsBody {
        min-width: 700px;
    }
}

/* Çok küçük ekranlar (telefon dikey) */
@media (max-width: 480px) {
    .stats-grid {
        grid-template-columns: 1fr !important;
    }

    .top-header {
        padding: 0 8px;
    }

    /* POS ürün kartları */
    .pos-products-grid {
        grid-template-columns: repeat(2, 1fr) !important;
    }

    /* Tablo font küçük */
    .table th,
    .table td {
        padding: 10px 8px !important;
        font-size: 12px !important;
    }

    .btn {
        padding: 7px 12px !important;
        font-size: 12px !important;
    }

    .btn-sm {
        padding: 4px 8px !important;
        font-size: 11px !important;
    }

    /* Kullanıcı kutusu kısa ekranda daha kompakt */
    .top-header [style*="padding:6px 10px"] {
        padding: 4px 6px !important;
    }

    /* Tarih gizle */
    .top-header > div:last-child > span[style*="font-size:13px"] {
        display: none;
    }
}

/* ============================================================
   ÇIKTI (YAZDIRMA) KURALLARI — TÜM SAYFALAR
   Butonlar/sidebar/menüler asla kağıda çıkmaz; dizayn masthead
   (cikti-print-head) ve imza bloğu (cikti-print-sign) yazdırırken açılır.
   ============================================================ */
/* Cikti ekleri (resim/PDF) ekranda gizlidir — yalnizca yazdirmada acilir */
.cikti-ekler { display: none; }
@media print {
    @page { size: A4 portrait; margin: 12mm 11mm; }
    .btn, a.btn, button, .btn-export, .action-btns, .no-print,
    .sidebar, .top-header, .page-footer, .hamburger, .alert,
    .sidebar-overlay { display: none !important; }
    .cikti-print-head { display: block !important; }
    .cikti-print-sign { display: flex !important; }
    .cikti-ekler { display: block !important; }
    .ts-ek-kutu { display: none !important; }
    .main-content { margin-left: 0 !important; }
    .page-body { padding: 0 !important; overflow: visible !important; }
    body { background: #fff !important; }
    .card { box-shadow: none !important; }
    /* Ekran içindaki yatay kaydirma ve tablo genisliklerini kagida cevir:
       A4 genisligi ~794px; min-width bırakılırsa tablo kagidi tasariyor,
       masthead sikisiyor ve yatay kaydirma cubugu cikiyordu. */
    .table-wrapper, .table-responsive { overflow: visible !important; }
    table, .table, .data-table { min-width: 0 !important; width: 100% !important; }
    table th, table td { word-break: break-word; }
    .table-thumb, img.table-thumb { max-width: 64px !important; max-height: 64px !important; }
    /* Tema renkleri (masthead seridi, tablo basliklari) kagida insin */
    * { -webkit-print-color-adjust: exact !important; print-color-adjust: exact !important; }
}
