/* =================================================
   ÇAY OCAĞI YÖNETİM SİSTEMİ - STIL DOSYASI
   Modern, Premium Admin Panel CSS
   ================================================= */

:root {
    --primary: #1e3a8a;          /* Lacivert */
    --primary-dark: #172554;
    --primary-light: #3b5bdb;
    --primary-50: #eff2ff;
    --accent: #f59e0b;
    --success: #10b981;
    --success-light: #d1fae5;
    --danger: #ef4444;
    --danger-light: #fee2e2;
    --warning: #f59e0b;
    --warning-light: #fef3c7;
    --info: #0ea5e9;
    --info-light: #e0f2fe;
    --bg: #f5f7fb;
    --bg-card: #ffffff;
    --text: #1e293b;
    --text-muted: #64748b;
    --border: #e2e8f0;
    --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.04);
    --shadow: 0 4px 12px rgba(15, 23, 42, 0.06);
    --shadow-lg: 0 10px 40px rgba(15, 23, 42, 0.1);
    --radius: 14px;
    --radius-sm: 10px;
    --radius-lg: 18px;
    --sidebar-w: 250px;
    --topbar-h: 64px;
    --transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

[data-bs-theme="dark"] {
    --primary: #3b5bdb;
    --primary-dark: #1e3a8a;
    --primary-light: #6680f0;
    --primary-50: #1e293b;
    --bg: #0f172a;
    --bg-card: #1e293b;
    --text: #e2e8f0;
    --text-muted: #94a3b8;
    --border: #334155;
    --success-light: #064e3b;
    --danger-light: #7f1d1d;
    --warning-light: #78350f;
    --info-light: #0c4a6e;
}

* { box-sizing: border-box; }

html, body {
    height: 100%;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: var(--bg);
    color: var(--text);
    margin: 0;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
}

/* === SCROLLBAR === */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 10px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }

/* ====================================
   LOGIN SAYFASI
   ==================================== */
.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #1e3a8a 0%, #3b5bdb 50%, #1e3a8a 100%);
    background-size: 400% 400%;
    animation: gradientMove 15s ease infinite;
    padding: 20px;
    position: relative;
    overflow: hidden;
}

@keyframes gradientMove {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}

.login-page::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image:
        radial-gradient(circle at 20% 30%, rgba(255,255,255,0.08) 0%, transparent 50%),
        radial-gradient(circle at 80% 70%, rgba(245, 158, 11, 0.1) 0%, transparent 50%);
    pointer-events: none;
}

.login-card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.25);
    width: 100%;
    max-width: 420px;
    padding: 50px 40px;
    position: relative;
    z-index: 1;
    animation: cardEnter 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes cardEnter {
    from { opacity: 0; transform: translateY(30px) scale(0.97); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

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

.login-logo .logo-circle {
    width: 80px;
    height: 80px;
    margin: 0 auto 18px;
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    border-radius: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 42px;
    box-shadow: 0 12px 30px rgba(30, 58, 138, 0.35);
    transform: rotate(-5deg);
    transition: transform 0.4s ease;
}

.login-logo .logo-circle:hover { transform: rotate(0deg) scale(1.05); }

.login-logo h1 {
    font-size: 24px;
    font-weight: 700;
    margin: 0 0 5px;
    color: var(--text);
}

.login-logo p {
    color: var(--text-muted);
    font-size: 14px;
    margin: 0;
}

.login-card .form-floating > .form-control {
    border-radius: var(--radius-sm);
    border: 1.5px solid var(--border);
    background: var(--bg);
    height: 58px;
    padding: 18px 16px 6px 16px;
    font-size: 15px;
    transition: var(--transition);
}

.login-card .form-floating > .form-control:focus {
    border-color: var(--primary);
    background: var(--bg-card);
    box-shadow: 0 0 0 4px rgba(30, 58, 138, 0.08);
}

.login-card .form-floating > label {
    color: var(--text-muted);
    padding: 18px 16px;
}

.login-btn {
    width: 100%;
    padding: 14px;
    font-size: 15px;
    font-weight: 600;
    border-radius: var(--radius-sm);
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    border: none;
    color: white;
    cursor: pointer;
    transition: var(--transition);
    box-shadow: 0 6px 18px rgba(30, 58, 138, 0.3);
    position: relative;
    overflow: hidden;
}

.login-btn:hover { transform: translateY(-2px); box-shadow: 0 10px 25px rgba(30, 58, 138, 0.4); }
.login-btn:active { transform: translateY(0); }
.login-btn:disabled { opacity: 0.7; cursor: not-allowed; }

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

/* ====================================
   TOPBAR
   ==================================== */
.topbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--topbar-h);
    background: var(--bg-card);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    padding: 0 18px;
    gap: 14px;
    z-index: 1030;
    box-shadow: var(--shadow-sm);
}

.topbar-toggle {
    background: transparent;
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 10px;
    color: var(--text);
    font-size: 22px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}

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

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

.topbar-logo {
    width: 38px;
    height: 38px;
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    border-radius: 11px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    box-shadow: 0 4px 12px rgba(30, 58, 138, 0.25);
}

.topbar-title {
    font-weight: 700;
    letter-spacing: -0.3px;
}

.topbar-right {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 8px;
}

.topbar-btn {
    background: transparent;
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 10px;
    color: var(--text);
    font-size: 17px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}

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

.topbar-user {
    display: flex;
    align-items: center;
    gap: 10px;
    background: transparent;
    border: 1px solid var(--border);
    padding: 6px 14px 6px 6px;
    border-radius: 100px;
    cursor: pointer;
    color: var(--text);
    font-weight: 500;
    font-size: 14px;
    transition: var(--transition);
}

.topbar-user:hover { background: var(--primary-50); border-color: var(--primary); }

.user-avatar {
    width: 32px;
    height: 32px;
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 14px;
}

/* ====================================
   SIDEBAR
   ==================================== */
.sidebar {
    position: fixed;
    top: var(--topbar-h);
    left: 0;
    bottom: 0;
    width: var(--sidebar-w);
    background: var(--bg-card);
    border-right: 1px solid var(--border);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 1020;
    overflow-y: auto;
}

.sidebar-inner {
    padding: 16px 12px;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.sidebar-menu {
    list-style: none;
    padding: 0;
    margin: 0;
    flex: 1;
}

.sidebar-menu li { margin-bottom: 3px; }
.sidebar-menu .sidebar-divider {
    height: 1px;
    background: var(--border);
    margin: 12px 12px;
}

.sidebar-menu a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 11px 14px;
    border-radius: 10px;
    color: var(--text-muted);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: var(--transition);
    position: relative;
}

.sidebar-menu a:hover {
    background: var(--primary-50);
    color: var(--primary);
    transform: translateX(2px);
}

.sidebar-menu a i {
    font-size: 18px;
    width: 22px;
    text-align: center;
}

.sidebar-menu li.active a {
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    color: white;
    box-shadow: 0 6px 16px rgba(30, 58, 138, 0.3);
}

.sidebar-menu li.active a:hover { transform: none; }

.sidebar-footer {
    text-align: center;
    color: var(--text-muted);
    padding: 14px;
    font-size: 12px;
    border-top: 1px solid var(--border);
    margin-top: 12px;
}

.sidebar-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1015;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s;
}

.sidebar-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

/* ====================================
   ANA İÇERİK
   ==================================== */
.main-content {
    margin-left: var(--sidebar-w);
    padding-top: var(--topbar-h);
    min-height: 100vh;
    transition: margin-left 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.app-body.sidebar-collapsed .sidebar { transform: translateX(-100%); }
.app-body.sidebar-collapsed .main-content { margin-left: 0; }

@media (max-width: 991px) {
    .main-content { margin-left: 0; }
    .sidebar { transform: translateX(-100%); }
    .app-body.sidebar-open .sidebar { transform: translateX(0); }
    .app-body.sidebar-open .sidebar-overlay { opacity: 1; pointer-events: auto; }
}

/* ====================================
   PAGE HEADER
   ==================================== */
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 22px;
}

.page-header h1 {
    font-size: 26px;
    font-weight: 700;
    margin: 0;
    color: var(--text);
    letter-spacing: -0.5px;
}

.page-header .breadcrumb-text {
    color: var(--text-muted);
    font-size: 13px;
    margin-top: 4px;
}

/* ====================================
   STAT KARTLARI
   ==================================== */
.stat-card {
    background: var(--bg-card);
    border-radius: var(--radius);
    padding: 20px 22px;
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
    position: relative;
    overflow: hidden;
    transition: var(--transition);
    height: 100%;
}

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

.stat-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0;
    width: 4px; height: 100%;
    background: var(--primary);
}

.stat-card.income::before { background: var(--success); }
.stat-card.expense::before { background: var(--danger); }
.stat-card.profit::before { background: var(--info); }
.stat-card.warning::before { background: var(--warning); }

.stat-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.stat-card .label {
    color: var(--text-muted);
    font-size: 13px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin: 0;
}

.stat-card .icon {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    color: white;
}

.stat-card.income .icon { background: linear-gradient(135deg, #10b981, #059669); }
.stat-card.expense .icon { background: linear-gradient(135deg, #ef4444, #dc2626); }
.stat-card.profit .icon { background: linear-gradient(135deg, #0ea5e9, #0284c7); }
.stat-card.warning .icon { background: linear-gradient(135deg, #f59e0b, #d97706); }

.stat-card .value {
    font-size: 24px;
    font-weight: 700;
    color: var(--text);
    margin: 0;
    line-height: 1.2;
    letter-spacing: -0.5px;
}

.stat-card.income .value { color: var(--success); }
.stat-card.expense .value { color: var(--danger); }
.stat-card.profit .value { color: var(--info); }

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

/* ====================================
   KART
   ==================================== */
.card {
    background: var(--bg-card);
    border-radius: var(--radius);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
}

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

.card-body {
    padding: 18px 20px;
}

.card-title {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
}

/* ====================================
   ÜRÜN GRID
   ==================================== */
.products-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 16px;
}

@media (max-width: 1199px) {
    .products-grid { grid-template-columns: repeat(4, 1fr); }
}
@media (max-width: 991px) {
    .products-grid { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 575px) {
    .products-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
}

.product-card {
    background: var(--bg-card);
    border: 2px solid var(--border);
    border-radius: var(--radius);
    padding: 16px;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
    cursor: pointer;
}

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

.product-card.stock-warning {
    background: linear-gradient(135deg, var(--warning-light), var(--bg-card));
    border-color: var(--warning);
}

.product-card.stock-critical {
    background: linear-gradient(135deg, var(--danger-light), var(--bg-card));
    border-color: var(--danger);
}

.product-card .product-icon {
    width: 40px;
    height: 40px;
    background: var(--primary-50);
    color: var(--primary);
    border-radius: 11px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    margin-bottom: 10px;
}

.product-card.stock-warning .product-icon {
    background: rgba(245, 158, 11, 0.2);
    color: var(--warning);
}

.product-card.stock-critical .product-icon {
    background: rgba(239, 68, 68, 0.2);
    color: var(--danger);
}

.product-card .product-name {
    font-weight: 600;
    margin: 0 0 6px;
    font-size: 14px;
    color: var(--text);
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.product-card .product-stock {
    font-size: 22px;
    font-weight: 700;
    color: var(--text);
    margin: 0;
    line-height: 1;
}

.product-card.stock-warning .product-stock { color: var(--warning); }
.product-card.stock-critical .product-stock { color: var(--danger); }

.product-card .product-unit {
    font-size: 12px;
    color: var(--text-muted);
    font-weight: 500;
    margin-left: 4px;
}

.product-card .product-meta {
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid var(--border);
    font-size: 11px;
    color: var(--text-muted);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.product-card .product-meta .badge {
    font-size: 9px;
    padding: 3px 7px;
}

.product-actions {
    margin-top: 10px;
    display: flex;
    gap: 4px;
}

.product-actions .btn {
    flex: 1;
    padding: 5px 0;
    font-size: 12px;
    border-radius: 8px;
}

/* ====================================
   BUTONLAR
   ==================================== */
.btn {
    border-radius: var(--radius-sm);
    font-weight: 500;
    padding: 8px 16px;
    transition: var(--transition);
    border: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.btn-sm { padding: 5px 11px; font-size: 13px; }

.btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    color: white;
    box-shadow: 0 4px 12px rgba(30, 58, 138, 0.2);
}
.btn-primary:hover { background: linear-gradient(135deg, var(--primary-dark), var(--primary)); transform: translateY(-1px); box-shadow: 0 6px 18px rgba(30, 58, 138, 0.3); color: white; }

.btn-success {
    background: linear-gradient(135deg, var(--success), #059669);
    color: white;
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.2);
}
.btn-success:hover { color: white; transform: translateY(-1px); box-shadow: 0 6px 18px rgba(16, 185, 129, 0.3); }

.btn-danger {
    background: linear-gradient(135deg, var(--danger), #dc2626);
    color: white;
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.2);
}
.btn-danger:hover { color: white; transform: translateY(-1px); box-shadow: 0 6px 18px rgba(239, 68, 68, 0.3); }

.btn-warning {
    background: linear-gradient(135deg, var(--warning), #d97706);
    color: white;
    box-shadow: 0 4px 12px rgba(245, 158, 11, 0.2);
}
.btn-warning:hover { color: white; transform: translateY(-1px); }

.btn-info {
    background: linear-gradient(135deg, var(--info), #0284c7);
    color: white;
}
.btn-info:hover { color: white; }

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

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

/* ====================================
   FORMLAR
   ==================================== */
.form-control, .form-select {
    border-radius: var(--radius-sm);
    border: 1.5px solid var(--border);
    padding: 9px 13px;
    font-size: 14px;
    transition: var(--transition);
    background: var(--bg-card);
    color: var(--text);
}

.form-control:focus, .form-select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(30, 58, 138, 0.08);
    background: var(--bg-card);
    color: var(--text);
}

.form-label {
    font-weight: 500;
    font-size: 13px;
    color: var(--text);
    margin-bottom: 5px;
}

/* ====================================
   TABLOLAR
   ==================================== */
.table {
    color: var(--text);
}

.table thead th {
    background: var(--bg);
    font-weight: 600;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
    border-bottom: 2px solid var(--border);
    padding: 12px;
}

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

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

/* ====================================
   BADGE
   ==================================== */
.badge {
    font-weight: 500;
    padding: 5px 10px;
    border-radius: 7px;
    font-size: 11px;
}

.badge-income, .badge.bg-success-soft { background: var(--success-light); color: var(--success); }
.badge-expense, .badge.bg-danger-soft { background: var(--danger-light); color: var(--danger); }
.badge.bg-warning-soft { background: var(--warning-light); color: var(--warning); }
.badge.bg-info-soft { background: var(--info-light); color: var(--info); }

/* ====================================
   ALERT
   ==================================== */
.alert {
    border-radius: var(--radius-sm);
    border: none;
    padding: 12px 16px;
    font-size: 14px;
    display: flex;
    align-items: center;
}

.alert-success { background: var(--success-light); color: var(--success); }
.alert-danger { background: var(--danger-light); color: var(--danger); }
.alert-warning { background: var(--warning-light); color: var(--warning); }
.alert-info { background: var(--info-light); color: var(--info); }

/* ====================================
   MODAL
   ==================================== */
.modal-content {
    border-radius: var(--radius);
    border: none;
    background: var(--bg-card);
    color: var(--text);
}

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

.modal-title {
    font-weight: 600;
    font-size: 17px;
}

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

/* ====================================
   GRAFİK CONTAINERS
   ==================================== */
.chart-container {
    position: relative;
    height: 320px;
}

@media (max-width: 768px) {
    .chart-container { height: 260px; }
}

/* ====================================
   LOADING
   ==================================== */
.loader-overlay {
    position: fixed;
    inset: 0;
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(4px);
    z-index: 9999;
    display: none;
    align-items: center;
    justify-content: center;
}

.loader-overlay.active { display: flex; }

[data-bs-theme="dark"] .loader-overlay { background: rgba(15, 23, 42, 0.7); }

.spinner {
    width: 50px;
    height: 50px;
    border: 4px solid var(--primary-50);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

/* ====================================
   UYUM
   ==================================== */
@media (max-width: 768px) {
    .topbar-title { font-size: 15px; }
    .page-header h1 { font-size: 20px; }
    .stat-card { padding: 16px; }
    .stat-card .value { font-size: 20px; }
    .card-header { padding: 12px 14px; }
    .card-body { padding: 14px; }
}

/* ====================================
   YAZDIRMA
   ==================================== */
@media print {
    .topbar, .sidebar, .sidebar-overlay, .no-print, .btn { display: none !important; }
    .main-content { margin: 0; padding: 0; }
    .card { box-shadow: none; border: 1px solid #ccc; }
    body { background: white; }
}

/* === DataTables ayarları === */
.dataTables_wrapper .dataTables_length,
.dataTables_wrapper .dataTables_filter,
.dataTables_wrapper .dataTables_info,
.dataTables_wrapper .dataTables_paginate {
    margin-bottom: 12px;
    color: var(--text-muted);
}

.dataTables_wrapper .dataTables_filter input,
.dataTables_wrapper .dataTables_length select {
    border-radius: var(--radius-sm);
    border: 1.5px solid var(--border);
    padding: 6px 12px;
    background: var(--bg-card);
    color: var(--text);
}

table.dataTable.no-footer { border-bottom: 1px solid var(--border); }

/* === Animasyonlar === */
.fade-in { animation: fadeIn 0.4s ease; }
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}
