/* ============================================
   KUAFÖR SATIŞ SİSTEMİ - ANA STİL DOSYASI
   Profesyonel UI/UX Tasarım
   ============================================ */

/* ---------- CSS Değişkenleri (Tema ile değişir) ---------- */
:root {
    --font-primary: 'Segoe UI', 'Roboto', -apple-system, BlinkMacSystemFont, sans-serif;
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 16px;
    --radius-xl: 24px;
    --shadow-sm: 0 1px 2px rgba(0,0,0,0.06), 0 1px 3px rgba(0,0,0,0.1);
    --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.1), 0 2px 4px -2px rgba(0,0,0,0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.1), 0 4px 6px -4px rgba(0,0,0,0.1);
    --shadow-xl: 0 20px 25px -5px rgba(0,0,0,0.2), 0 8px 10px -6px rgba(0,0,0,0.1);
    --transition-fast: all 0.15s ease;
    --transition-normal: all 0.25s ease;
    --sidebar-width: 260px;
    --sidebar-collapsed: 72px;
    --topbar-height: 64px;
    --bg-gradient: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
}

/* ---------- Reset & Base ---------- */
* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
    font-family: var(--font-primary);
    background: var(--bg);
    color: var(--text);
    font-size: 14px;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    min-height: 100vh;
}

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

/* ---------- Scrollbar ---------- */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--primary); border-radius: 4px; }

/* ============================================
   LOGIN PAGE
   ============================================ */
.login-page {
    background: var(--bg);
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    position: relative;
    overflow: hidden;
}

.login-backdrop {
    position: fixed;
    inset: 0;
    background:
        radial-gradient(circle at 20% 20%, rgba(255,255,255,0.05) 0%, transparent 50%),
        radial-gradient(circle at 80% 80%, rgba(255,255,255,0.05) 0%, transparent 50%),
        var(--bg);
}

.login-backdrop::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image:
        radial-gradient(var(--primary) 1px, transparent 1px),
        radial-gradient(var(--primary) 1px, transparent 1px);
    background-size: 60px 60px;
    background-position: 0 0, 30px 30px;
    opacity: 0.06;
}

.auth-wrapper {
    position: relative;
    z-index: 2;
    width: 100%;
    max-width: 460px;
    padding: 20px;
}

.auth-card {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    padding: 40px 38px;
    box-shadow: var(--shadow-xl);
    backdrop-filter: blur(10px);
}

.auth-logo-wrap { text-align: center; margin-bottom: 30px; }

.auth-logo {
    width: 72px;
    height: 72px;
    object-fit: contain;
    border-radius: var(--radius-lg);
    margin-bottom: 14px;
    box-shadow: var(--shadow-lg);
}

.auth-logo-fallback {
    width: 72px;
    height: 72px;
    margin: 0 auto 14px;
    border-radius: var(--radius-lg);
    background: var(--bg-gradient);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 32px;
    color: #fff;
    box-shadow: var(--shadow-lg);
}

.auth-title {
    font-size: 24px;
    font-weight: 800;
    color: var(--heading-color);
    letter-spacing: -0.02em;
    margin-bottom: 4px;
}

.auth-subtitle {
    font-size: 13px;
    color: var(--text-muted);
    margin-bottom: 0;
}

.auth-form .form-group { margin-bottom: 18px; }

.input-icon-wrap {
    position: relative;
}

.input-icon-wrap .input-icon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    font-size: 15px;
    pointer-events: none;
    z-index: 2;
}

.input-icon-wrap .form-control {
    padding-left: 44px;
    height: 50px;
    background: var(--input-bg);
    border: 1.5px solid var(--border);
    color: var(--text);
    font-size: 15px;
    border-radius: var(--radius-md);
    transition: var(--transition-normal);
}

.input-icon-wrap .form-control:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px var(--primary-soft);
    background: var(--input-bg-focus);
}

.btn-icon-inside {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 8px;
    font-size: 15px;
    border-radius: var(--radius-sm);
    transition: var(--transition-fast);
}

.btn-icon-inside:hover { color: var(--primary); }

.auth-options { display: flex; align-items: center; justify-content: space-between; margin-bottom: 22px; }

.custom-checkbox {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-size: 13px;
    color: var(--text-muted);
    user-select: none;
}

.custom-checkbox input[type="checkbox"] { display: none; }

.custom-checkbox .checkmark {
    width: 20px;
    height: 20px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    position: relative;
    transition: var(--transition-fast);
    color: transparent;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
}

.custom-checkbox input[type="checkbox"]:checked + .checkmark {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
}

.custom-checkbox input[type="checkbox"]:checked + .checkmark::after {
    content: '\f00c';
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
}

.auth-submit {
    height: 50px;
    font-size: 16px;
    font-weight: 600;
    letter-spacing: 0.02em;
    border: none;
    border-radius: var(--radius-md);
    width: 100%;
    background: var(--bg-gradient);
    color: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    transition: var(--transition-normal);
    box-shadow: var(--shadow-md);
}

.auth-submit:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-lg);
    color: #fff;
}

.auth-submit:active { transform: translateY(0); }

.auth-footer {
    text-align: center;
    margin-top: 26px;
    font-size: 13px;
    color: var(--text-muted);
}

.auth-version {
    font-size: 11px;
    opacity: 0.6;
    margin-top: 10px;
}

/* ---------- Animasyonlar ---------- */
@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(12px); }
    to { opacity: 1; transform: translateY(0); }
}

.animate-in { animation: fadeInUp 0.45s ease forwards; }
.animate-in:nth-child(2) { animation-delay: 0.1s; }
.animate-in:nth-child(3) { animation-delay: 0.18s; }
.animate-in:nth-child(4) { animation-delay: 0.26s; }

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

/* ---------- Sidebar ---------- */
.sidebar {
    width: var(--sidebar-width);
    background: var(--sidebar-bg);
    color: var(--sidebar-text);
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    z-index: 1000;
    transition: width var(--transition-normal), transform var(--transition-normal);
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    overflow-x: hidden;
    box-shadow: 2px 0 12px rgba(0,0,0,0.1);
}

.sidebar-collapsed .sidebar { width: var(--sidebar-collapsed); }

.sidebar-header {
    padding: 18px 20px;
    display: flex;
    align-items: center;
    gap: 14px;
    border-bottom: 1px solid var(--sidebar-border);
    min-height: var(--topbar-height);
    position: sticky;
    top: 0;
    background: inherit;
    z-index: 2;
}

.sidebar-logo {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-md);
    object-fit: cover;
    flex-shrink: 0;
}

.sidebar-logo-fallback {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-md);
    background: var(--bg-gradient);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 18px;
    flex-shrink: 0;
}

.sidebar-title {
    font-weight: 700;
    font-size: 16px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: var(--sidebar-title);
}

.sidebar-collapsed .sidebar-title { display: none; }

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

.sidebar-section {
    padding: 0 12px;
    margin-top: 6px;
}

.sidebar-section-title {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--sidebar-muted);
    padding: 8px 12px;
    white-space: nowrap;
}

.sidebar-collapsed .sidebar-section-title {
    text-align: center;
    padding: 8px 0;
    font-size: 0;
}

.sidebar-collapsed .sidebar-section-title::after {
    content: '';
    display: block;
    width: 24px;
    height: 1px;
    background: var(--sidebar-border);
    margin: 0 auto;
}

.sidebar-nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 11px 12px;
    color: var(--sidebar-text) !important;
    border-radius: var(--radius-md);
    margin-bottom: 2px;
    font-weight: 500;
    font-size: 13.5px;
    white-space: nowrap;
    position: relative;
    transition: var(--transition-fast);
    cursor: pointer;
}

.sidebar-nav-item i {
    width: 20px;
    text-align: center;
    font-size: 16px;
    flex-shrink: 0;
}

.sidebar-nav-item:hover {
    background: var(--sidebar-hover);
    color: var(--sidebar-text-hover) !important;
}

.sidebar-nav-item.active {
    background: var(--bg-gradient);
    color: #fff !important;
    box-shadow: var(--shadow-md);
}

.sidebar-nav-item .nav-label { flex: 1; }

.sidebar-collapsed .sidebar-nav-item .nav-label { display: none; }

.sidebar-collapsed .sidebar-nav-item {
    justify-content: center;
    padding: 13px;
    border-radius: var(--radius-md);
}

.sidebar-badge {
    background: var(--danger);
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    padding: 2px 7px;
    border-radius: 20px;
    min-width: 20px;
    text-align: center;
}

.sidebar-collapsed .sidebar-badge { position: absolute; top: 6px; right: 6px; }

.sidebar-footer {
    padding: 14px;
    border-top: 1px solid var(--sidebar-border);
}

.sidebar-collapsed .sidebar-footer { padding: 10px; }

/* ---------- Main Content ---------- */
.main-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    transition: margin-left var(--transition-normal);
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    position: relative;
    overflow-x: hidden;
}

.sidebar-collapsed .main-content { margin-left: var(--sidebar-collapsed); }

/* ---------- Topbar ---------- */
.topbar {
    height: var(--topbar-height);
    background: var(--card-bg);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    padding: 0 24px;
    gap: 16px;
    position: sticky;
    top: 0;
    z-index: 900;
    backdrop-filter: blur(8px);
}

.topbar-toggle {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 18px;
    cursor: pointer;
    padding: 8px;
    border-radius: var(--radius-md);
    transition: var(--transition-fast);
}

.topbar-toggle:hover { background: var(--bg); color: var(--primary); }

.topbar-title {
    font-size: 16px;
    font-weight: 700;
    color: var(--heading-color);
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.topbar-search {
    position: relative;
    width: 300px;
}

.topbar-search input {
    width: 100%;
    height: 38px;
    padding: 0 14px 0 40px;
    border: 1.5px solid var(--border);
    border-radius: 20px;
    background: var(--input-bg);
    color: var(--text);
    font-size: 13px;
    transition: var(--transition-normal);
}

.topbar-search input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-soft);
    outline: none;
    background: var(--input-bg-focus);
}

.topbar-search i {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    font-size: 13px;
}

.topbar-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.topbar-action-btn {
    position: relative;
    background: var(--bg);
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    font-size: 16px;
    cursor: pointer;
    transition: var(--transition-fast);
}

.topbar-action-btn:hover {
    background: var(--primary-soft);
    color: var(--primary);
}

.topbar-action-btn .notif-badge {
    position: absolute;
    top: 4px;
    right: 4px;
    min-width: 18px;
    height: 18px;
    background: var(--danger);
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 4px;
    border: 2px solid var(--card-bg);
}

/* ---------- User Menu ---------- */
.user-menu-btn {
    display: flex;
    align-items: center;
    gap: 10px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: var(--radius-md);
    transition: var(--transition-fast);
}

.user-menu-btn:hover { background: var(--bg); }

.user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--bg-gradient);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 14px;
    letter-spacing: 0.05em;
}

.user-info {
    text-align: left;
    line-height: 1.2;
}

.user-info .name {
    font-weight: 600;
    font-size: 13px;
    color: var(--heading-color);
    white-space: nowrap;
}

.user-info .role {
    font-size: 11px;
    color: var(--text-muted);
}

.dropdown-menu {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    padding: 6px;
    min-width: 200px;
}

.dropdown-menu .dropdown-item {
    padding: 9px 14px;
    border-radius: var(--radius-sm);
    color: var(--text);
    font-size: 13px;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: var(--transition-fast);
}

.dropdown-menu .dropdown-item:hover {
    background: var(--bg);
    color: var(--primary);
}

.dropdown-menu .dropdown-item i { width: 18px; text-align: center; }

.dropdown-header {
    padding: 10px 14px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    border-bottom: 1px solid var(--border);
    margin-bottom: 6px;
}

.dropdown-divider { border-color: var(--border); }

/* ---------- Notifications Panel ---------- */
.notifications-panel {
    width: 360px;
    max-width: 100vw;
}

.notifications-panel .notif-list {
    max-height: 360px;
    overflow-y: auto;
}

.notif-item {
    display: flex;
    gap: 12px;
    padding: 12px;
    border-radius: var(--radius-md);
    transition: var(--transition-fast);
    border: 1px solid transparent;
}

.notif-item:hover { background: var(--bg); }

.notif-item.unread { background: var(--primary-soft-light); }

.notif-item.unread:hover { background: var(--primary-soft); }

.notif-icon {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 15px;
    flex-shrink: 0;
}

.notif-icon.type-siparis { background: var(--info-soft); color: var(--info); }
.notif-icon.type-odeme { background: rgba(23,201,100,0.15); color: #17c964; }
.notif-icon.type-stok { background: var(--warning-soft); color: var(--warning); }
.notif-icon.type-sistem { background: var(--secondary-soft); color: var(--secondary); }
.notif-icon.type-genel { background: var(--primary-soft); color: var(--primary); }

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

.notif-title {
    font-weight: 600;
    font-size: 13px;
    color: var(--heading-color);
    margin-bottom: 2px;
}

.notif-message {
    font-size: 12px;
    color: var(--text-muted);
    line-height: 1.4;
}

.notif-time {
    font-size: 11px;
    color: var(--text-muted);
    opacity: 0.7;
    margin-top: 4px;
}

/* ---------- Content Area ---------- */
.page-content {
    padding: 24px;
    flex: 1;
}

.page-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 22px;
    flex-wrap: wrap;
}

.page-title {
    font-size: 20px;
    font-weight: 800;
    color: var(--heading-color);
    letter-spacing: -0.01em;
}

.page-subtitle {
    font-size: 13px;
    color: var(--text-muted);
    margin-top: 2px;
}

/* ---------- Footer ---------- */
.app-footer {
    padding: 16px 24px;
    border-top: 1px solid var(--border);
    font-size: 12px;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 8px;
    background: var(--card-bg);
}

/* ============================================
   COMPONENTS
   ============================================ */

/* ---------- Alert ---------- */
.alert {
    border-radius: var(--radius-md);
    padding: 13px 16px;
    font-size: 13px;
    border: none;
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 16px;
    animation: fadeInUp 0.3s ease;
}

.alert-dismissible .btn-close {
    margin-left: auto;
    position: static;
}

.alert-success { background: rgba(23,201,100,0.12); color: #0e8a4d; }
.alert-danger { background: rgba(239,68,68,0.12); color: #c42b2b; }
.alert-warning { background: rgba(245,158,11,0.12); color: #b45309; }
.alert-info { background: rgba(59,130,246,0.12); color: #1d4ed8; }

/* ---------- Buttons ---------- */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 9px 18px;
    border-radius: var(--radius-md);
    font-size: 13px;
    font-weight: 600;
    border: none;
    cursor: pointer;
    transition: var(--transition-normal);
    line-height: 1.5;
    text-decoration: none;
}

.btn:focus { outline: none; box-shadow: 0 0 0 4px var(--primary-soft); }

.btn-primary {
    background: var(--bg-gradient);
    color: #fff !important;
    box-shadow: var(--shadow-sm);
}

.btn-primary:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-1px);
    color: #fff !important;
}

.btn-secondary {
    background: var(--secondary);
    color: #fff !important;
}

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

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

.btn-danger { background: var(--danger); color: #fff !important; }
.btn-success { background: #17c964; color: #fff !important; }
.btn-warning { background: var(--warning); color: #fff !important; }
.btn-info { background: var(--info); color: #fff !important; }

.btn-sm { padding: 6px 12px; font-size: 12px; }
.btn-lg { padding: 12px 24px; font-size: 15px; }
.btn-block { display: flex; width: 100%; justify-content: center; }

/* ---------- Cards ---------- */
.card {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    margin-bottom: 20px;
    overflow: hidden;
    transition: var(--transition-normal);
}

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

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

.card-header h3 {
    font-size: 15px;
    font-weight: 700;
    color: var(--heading-color);
    margin: 0;
}

.card-body { padding: 20px; }

.card-footer {
    padding: 14px 20px;
    border-top: 1px solid var(--border);
    background: var(--bg);
}

/* ---------- Stat Cards ---------- */
.stat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 18px;
    margin-bottom: 22px;
}

.stat-card {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 20px;
    position: relative;
    overflow: hidden;
    transition: var(--transition-normal);
    cursor: pointer;
}

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

.stat-card::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--stat-color, var(--primary));
}

.stat-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    margin-bottom: 14px;
    background: var(--stat-bg, var(--primary-soft));
    color: var(--stat-color, var(--primary));
}

.stat-value {
    font-size: 26px;
    font-weight: 800;
    color: var(--heading-color);
    letter-spacing: -0.02em;
    line-height: 1.2;
}

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

.stat-trend {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 11px;
    font-weight: 600;
    margin-top: 8px;
    padding: 3px 8px;
    border-radius: 20px;
}

.stat-trend.up { background: rgba(23,201,100,0.12); color: #0e8a4d; }
.stat-trend.down { background: rgba(239,68,68,0.12); color: #c42b2b; }

/* ---------- Tables ---------- */
.table-responsive { overflow-x: auto; }

.table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.table thead th {
    padding: 12px 16px;
    text-align: left;
    font-weight: 600;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    background: var(--bg);
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
}

.table tbody td {
    padding: 12px 16px;
    border-bottom: 1px solid var(--border);
    vertical-align: middle;
}

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

.table tbody tr:hover { background: var(--bg); }

.table .text-right { text-align: right; }
.table .text-center { text-align: center; }

/* ---------- Badges ---------- */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.03em;
}

.badge-primary { background: var(--primary-soft); color: var(--primary); }
.badge-success { background: rgba(23,201,100,0.12); color: #0e8a4d; }
.badge-danger { background: rgba(239,68,68,0.12); color: #c42b2b; }
.badge-warning { background: var(--warning-soft); color: var(--warning); }
.badge-info { background: var(--info-soft); color: var(--info); }
.badge-secondary { background: var(--secondary-soft); color: var(--secondary); }

/* Durum badge farklı sınıflar */
.badge-status-beklemede { background: var(--warning-soft); color: #b45309; }
.badge-status-hazirlaniyor { background: var(--info-soft); color: #1d4ed8; }
.badge-status-hazir { background: rgba(23,201,100,0.12); color: #0e8a4d; }
.badge-status-kargoya_verildi { background: var(--secondary-soft); color: var(--secondary); }
.badge-status-teslim_edildi { background: rgba(23,201,100,0.12); color: #0e8a4d; }
.badge-status-iptal { background: rgba(239,68,68,0.12); color: #c42b2b; }

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

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

.form-control {
    width: 100%;
    padding: 10px 14px;
    background: var(--input-bg);
    border: 1.5px solid var(--border);
    border-radius: var(--radius-md);
    color: var(--text);
    font-size: 13.5px;
    font-family: inherit;
    transition: var(--transition-normal);
}

.form-control:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px var(--primary-soft);
    outline: none;
    background: var(--input-bg-focus);
}

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

select.form-control {
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2393a5b1' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 16px;
    padding-right: 40px;
}

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

.input-group {
    display: flex;
    gap: 10px;
}

.input-group > * { flex: 1; }

.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 14px;
}

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

/* ---------- Tabs ---------- */
.nav-tabs {
    border-bottom: 2px solid var(--border);
    display: flex;
    gap: 4px;
    margin-bottom: 20px;
    overflow-x: auto;
}

.nav-tabs .tab-link {
    padding: 10px 18px;
    color: var(--text-muted);
    font-weight: 600;
    font-size: 13px;
    border: none;
    background: none;
    cursor: pointer;
    border-bottom: 3px solid transparent;
    margin-bottom: -2px;
    transition: var(--transition-fast);
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.nav-tabs .tab-link:hover { color: var(--primary); }

.nav-tabs .tab-link.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
}

/* ---------- Modal ---------- */
.modal-content {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    border: none;
}

.modal-header {
    padding: 18px 22px;
    border-bottom: 1px solid var(--border);
}

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

.modal-header .btn-close {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 18px;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: var(--radius-sm);
}

.modal-header .btn-close:hover { background: var(--bg); color: var(--danger); }

.modal-body { padding: 22px; }

.modal-footer {
    padding: 14px 22px;
    border-top: 1px solid var(--border);
    gap: 10px;
}

/* ---------- Pagination ---------- */
.pagination { margin-top: 20px; }

.pagination ul {
    display: flex;
    gap: 6px;
    list-style: none;
    flex-wrap: wrap;
}

.pagination li a, .pagination li span {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    height: 36px;
    padding: 0 8px;
    border-radius: var(--radius-md);
    border: 1.5px solid var(--border);
    color: var(--text);
    font-size: 13px;
    font-weight: 600;
    transition: var(--transition-fast);
    background: var(--card-bg);
}

.pagination li a:hover {
    border-color: var(--primary);
    color: var(--primary);
}

.pagination li.active span, .pagination li.active a {
    background: var(--bg-gradient);
    border-color: transparent;
    color: #fff !important;
}

/* ---------- Empty State ---------- */
.empty-state {
    text-align: center;
    padding: 50px 20px;
    color: var(--text-muted);
}

.empty-state i {
    font-size: 52px;
    margin-bottom: 16px;
    opacity: 0.4;
}

.empty-state h4 {
    font-weight: 700;
    color: var(--heading-color);
    margin-bottom: 6px;
}

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

/* ---------- Toasts ---------- */
.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.app-toast {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    padding: 14px 18px;
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 300px;
    max-width: 400px;
    animation: slideInRight 0.3s ease;
}

.app-toast.success { border-left: 4px solid #17c964; }
.app-toast.danger { border-left: 4px solid var(--danger); }
.app-toast.warning { border-left: 4px solid var(--warning); }
.app-toast.info { border-left: 4px solid var(--info); }

.app-toast .toast-icon { font-size: 18px; }
.app-toast.success .toast-icon { color: #17c964; }
.app-toast.danger .toast-icon { color: var(--danger); }
.app-toast.warning .toast-icon { color: var(--warning); }
.app-toast.info .toast-icon { color: var(--info); }

.app-toast.fade-out { animation: fadeOut 0.3s ease forwards; }

@keyframes slideInRight {
    from { opacity: 0; transform: translateX(80px); }
    to { opacity: 1; transform: translateX(0); }
}

@keyframes fadeOut {
    from { opacity: 1; }
    to { opacity: 0; transform: translateX(80px); }
}

/* ---------- Skeleton Loading ---------- */
.skeleton {
    background: linear-gradient(90deg, var(--bg) 25%, var(--border) 50%, var(--bg) 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: var(--radius-sm);
}

@keyframes shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* ---------- Loading Overlay ---------- */
.loading-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9998;
    backdrop-filter: blur(2px);
    opacity: 0;
    visibility: hidden;
    transition: var(--transition-normal);
}

.loading-overlay.show {
    opacity: 1;
    visibility: visible;
}

.loading-spinner {
    width: 48px;
    height: 48px;
    border: 4px solid rgba(255,255,255,0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

/* ============================================
   PRINT (Sipariş Fişi)
   ============================================ */
@media print {
    .sidebar, .topbar, .app-footer, .print-hide, .btn, .page-toolbar {
        display: none !important;
    }
    .main-content {
        margin-left: 0 !important;
        padding: 0 !important;
    }
    .page-content { padding: 0 !important; }
    .card { box-shadow: none; border: none; }
    body { background: #fff !important; }
}

.print-area {
    font-size: 13px;
}

.invoice-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 30px;
    gap: 20px;
    flex-wrap: wrap;
}

.invoice-title {
    font-size: 28px;
    font-weight: 800;
    color: var(--heading-color);
    letter-spacing: -0.02em;
}

.invoice-meta {
    text-align: right;
    font-size: 13px;
    line-height: 1.8;
}

.invoice-meta strong { color: var(--heading-color); }

.invoice-parts {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    margin-bottom: 30px;
}

.invoice-part-title {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-muted);
    margin-bottom: 10px;
    padding-bottom: 6px;
    border-bottom: 2px solid var(--primary);
    display: inline-block;
}

.invoice-lines { font-size: 13px; line-height: 2; }

.invoice-totals {
    width: 320px;
    margin-left: auto;
    margin-top: 20px;
}

.invoice-total-row {
    display: flex;
    justify-content: space-between;
    padding: 6px 0;
    font-size: 13px;
}

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

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 992px) {
    .sidebar {
        transform: translateX(-100%);
        width: var(--sidebar-width) !important;
    }
    .sidebar.mobile-open {
        transform: translateX(0);
        box-shadow: var(--shadow-xl);
    }
    .main-content { margin-left: 0 !important; }
    .topbar-search { display: none; }
    .stat-grid { grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); }
}

@media (max-width: 768px) {
    .page-content { padding: 16px; }
    .topbar { padding: 0 14px; }
    .user-info { display: none; }
    .invoice-parts { grid-template-columns: 1fr; }
    .invoice-totals { width: 100%; }
    .notifications-panel { width: 100vw; }
}

@media (max-width: 576px) {
    .auth-card { padding: 30px 22px; }
    .stat-grid { grid-template-columns: 1fr; }
    .form-row { grid-template-columns: 1fr; }
    .card-header { flex-direction: column; align-items: flex-start; }
}

/* ---------- Utility ---------- */
.text-primary { color: var(--primary) !important; }
.text-success { color: #17c964 !important; }
.text-danger { color: var(--danger) !important; }
.text-warning { color: var(--warning) !important; }
.text-info { color: var(--info) !important; }
.text-muted { color: var(--text-muted) !important; }
.text-white { color: #fff !important; }
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-bold { font-weight: 700; }

.mt-0 { margin-top: 0; } .mt-1 { margin-top: 4px; } .mt-2 { margin-top: 8px; }
.mt-3 { margin-top: 16px; } .mt-4 { margin-top: 24px; } .mt-5 { margin-top: 40px; }
.mb-0 { margin-bottom: 0; } .mb-1 { margin-bottom: 4px; } .mb-2 { margin-bottom: 8px; }
.mb-3 { margin-bottom: 16px; } .mb-4 { margin-bottom: 24px; } .mb-5 { margin-bottom: 40px; }
.mx-auto { margin-left: auto; margin-right: auto; }
.ml-auto { margin-left: auto; }
.mr-auto { margin-right: auto; }

.p-0 { padding: 0; } .p-1 { padding: 4px; } .p-2 { padding: 8px; }
.p-3 { padding: 16px; } .p-4 { padding: 24px; } .p-5 { padding: 40px; }

.d-none { display: none; }
.d-flex { display: flex; }
.d-block { display: block; }
.flex-wrap { flex-wrap: wrap; }
.align-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-2 { gap: 8px; } .gap-3 { gap: 16px; }

.w-100 { width: 100%; }

/* ---------- Theme Preview ---------- */
.theme-preview-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 16px;
}

.theme-preview {
    border: 2px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    cursor: pointer;
    transition: var(--transition-normal);
    background: var(--card-bg);
}

.theme-preview:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); }

.theme-preview.active { border-color: var(--primary); box-shadow: 0 0 0 4px var(--primary-soft); }

.theme-preview-thumb {
    height: 90px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    color: #fff;
}

.theme-preview-info {
    padding: 10px;
    text-align: center;
    font-size: 12px;
    font-weight: 600;
}

/* ---------- Date Picker / Filter ---------- */
.filter-bar {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    align-items: flex-end;
}

.filter-bar .form-group { margin-bottom: 0; }

/* ---------- Action Buttons in Table ---------- */
.table-actions {
    display: flex;
    gap: 4px;
    justify-content: flex-end;
}

.table-actions .btn-icon {
    width: 32px;
    height: 32px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-sm);
    font-size: 13px;
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    transition: var(--transition-fast);
}

.table-actions .btn-icon:hover { background: var(--bg); color: var(--primary); }
.table-actions .btn-icon.btn-danger-icon:hover { background: rgba(239,68,68,0.1); color: var(--danger); }

/* ---------- Product Image ---------- */
.product-thumb {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-sm);
    object-fit: cover;
    background: var(--bg);
}

/* ---------- Avatar Group ---------- */
.avatar-group {
    display: flex;
    align-items: center;
}

.avatar-stack {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--bg-gradient);
    border: 2px solid var(--card-bg);
    margin-left: -10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    color: #fff;
    font-weight: 700;
}

.avatar-stack:first-child { margin-left: 0; }

/* ---------- Progress Bar ---------- */
.progress {
    height: 6px;
    background: var(--bg);
    border-radius: 20px;
    overflow: hidden;
    margin-top: 8px;
}

.progress-bar {
    height: 100%;
    border-radius: 20px;
    background: var(--bg-gradient);
    transition: width 0.5s ease;
}

/* ---------- Order Timeline ---------- */
.timeline {
    display: flex;
    gap: 4px;
    margin: 8px 0;
}

.timeline-step {
    flex: 1;
    height: 4px;
    border-radius: 4px;
    background: var(--border);
}

.timeline-step.done { background: #17c964; }
.timeline-step.current { background: var(--primary); }

/* ---------- Title with Icon ---------- */
.title-with-icon {
    display: flex;
    align-items: center;
    gap: 10px;
}

.title-with-icon .title-icon {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-sm);
    background: var(--primary-soft);
    color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
}

/* ---------- Search Select (ITask) ---------- */
.search-select-wrap { position: relative; }

.search-select-results {
    position: absolute;
    top: 105%;
    left: 0;
    right: 0;
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    max-height: 250px;
    overflow-y: auto;
    z-index: 100;
    display: none;
}

.search-select-results.show { display: block; }

.search-select-item {
    padding: 10px 14px;
    cursor: pointer;
    transition: var(--transition-fast);
    border-bottom: 1px solid var(--border);
}

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

.search-select-item:hover { background: var(--bg); }

.search-select-item .item-title { font-weight: 600; font-size: 13px; }
.search-select-item .item-sub { font-size: 11px; color: var(--text-muted); }

/* ---------- Storefront (Vitrin) ---------- */
.storefront {
    min-height: 100vh;
    background: var(--bg);
    color: var(--text);
    display: flex;
    flex-direction: column;
}

.storefront .container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    width: 100%;
}

.storefront-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    background: var(--card-bg);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 50;
}

.storefront-nav .nav-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--text);
    font-weight: 800;
    font-size: 17px;
    text-decoration: none;
}

.storefront-nav .nav-brand img {
    max-height: 36px;
    border-radius: var(--radius-sm);
}

.storefront-nav .nav-brand .brand-fallback {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-sm);
    background: var(--bg-gradient);
    color: #fff;
    font-size: 16px;
}

.storefront-nav .nav-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.storefront-hero {
    background: linear-gradient(135deg, var(--primary), var(--primary-soft));
    color: #fff;
    padding: 56px 20px;
    text-align: center;
}

.storefront-hero h1 { font-size: 30px; font-weight: 800; margin-bottom: 10px; }
.storefront-hero p { font-size: 15px; opacity: 0.92; max-width: 620px; margin: 0 auto 20px; }

.storefront-section { padding: 34px 0 6px; }
.storefront-section-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 18px;
}
.storefront-section-title h2 { font-size: 19px; font-weight: 800; margin: 0; }
.storefront-section-title a { font-size: 13px; }

.storefront-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 16px;
    padding-bottom: 28px;
}

.storefront-card {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: var(--transition-fast);
}

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

.storefront-card .p-image {
    height: 150px;
    background: var(--bg);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.storefront-card .p-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.storefront-card .p-image .p-placeholder { font-size: 40px; color: var(--primary-soft); }

.storefront-card .p-body {
    padding: 14px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.storefront-card .p-code { font-size: 11px; color: var(--text-muted); }
.storefront-card .p-name {
    font-weight: 700;
    font-size: 13.5px;
    line-height: 1.4;
    margin: 6px 0 10px;
    flex: 1;
}
.storefront-card .p-cat { font-size: 11px; color: var(--primary); margin-bottom: 8px; }

.storefront-card .p-buy {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}
.storefront-card .p-price { font-weight: 800; font-size: 15px; color: var(--primary); }

.storefront-footer {
    margin-top: auto;
    background: var(--card-bg);
    border-top: 1px solid var(--border);
    padding: 26px 20px;
    text-align: center;
    font-size: 13px;
    color: var(--text-muted);
}

/* Ürün detay sayfası */
.storefront-detail { display: grid; grid-template-columns: 1fr 1fr; gap: 30px; padding: 30px 0 50px; }
@media (max-width: 768px) { .storefront-detail { grid-template-columns: 1fr; } }
.storefront-detail .d-image {
    border-radius: var(--radius-md);
    background: var(--card-bg);
    border: 1px solid var(--border);
    min-height: 320px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}
.storefront-detail .d-image img { width: 100%; height: 100%; max-height: 480px; object-fit: contain; }
.storefront-detail .d-image .p-placeholder { font-size: 90px; color: var(--primary-soft); }
.storefront-detail .d-title { font-size: 24px; font-weight: 800; margin: 0 0 6px; }
.storefront-detail .d-code { color: var(--text-muted); font-size: 13px; margin-bottom: 14px; }
.storefront-detail .d-price { font-size: 26px; font-weight: 800; color: var(--primary); margin-bottom: 16px; }
.storefront-detail .d-desc { color: var(--text-muted); font-size: 14px; line-height: 1.7; margin-bottom: 22px; }