@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

:root {
    /* Brand Colors */
    --primary: #545ceb;
    --primary-hover: #434bd9;
    --bg-main: #f8f9fc;
    --surface: #ffffff;
    
    /* Text Colors */
    --text-strong: #1e293b;
    --text-normal: #334155;
    --text-muted: #64748b;
    --text-lighter: #94a3b8;
    
    /* UI Colors */
    --border-soft: #f1f5f9;
    --border-strong: #e2e8f0;
    --input-bg: #f8fafc;
    
    /* Status Colors */
    --st-new-bg: #eff6ff; --st-new-text: #2563eb;
    --st-app-bg: #dcfce7; --st-app-text: #16a34a;
    --st-del-bg: #fff7ed; --st-del-text: #ea580c;
    --st-unr-bg: #f1f5f9; --st-unr-text: #64748b;
    --st-shp-bg: #f3e8ff; --st-shp-text: #9333ea;
    --st-rtn-bg: #ffe4e6; --st-rtn-text: #9f1239; /* İade Edildi (6): Koyu Pembe/Bordo */
    --st-dlv-bg: #ecfdf5; --st-dlv-text: #047857; /* Teslim Edildi (7): Koyu Zümrüt Yeşili */
    --st-dlt-bg: #fef2f2; --st-dlt-text: #dc2626;

    /* Metrics */
    --sidebar-w: 240px;
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 20px;
    --shadow-soft: 0 4px 20px rgba(0, 0, 0, 0.03);
    --shadow-input: inset 0 2px 4px 0 rgba(0, 0, 0, 0.02);
}

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-main);
    color: var(--text-normal);
    font-size: 0.875rem;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

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

/* Buttons */
.btn {
    border-radius: var(--radius-md);
    font-weight: 600;
    padding: 0.65rem 1.25rem;
    transition: all 0.2s;
    border: none;
    font-size: 0.875rem;
}

.btn-primary {
    background-color: var(--primary);
    color: #fff;
    box-shadow: 0 4px 10px rgba(84, 92, 235, 0.25);
}
.btn-primary:hover {
    background-color: var(--primary-hover);
    transform: translateY(-1px);
    box-shadow: 0 6px 15px rgba(84, 92, 235, 0.35);
}

/* Base Cards */
.card {
    background: var(--surface);
    border: none;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-soft);
    margin-bottom: 1.5rem;
}
.card-header {
    background: transparent;
    border-bottom: 1px solid var(--border-soft);
    padding: 1.5rem;
    font-weight: 700;
    color: var(--text-strong);
}
.card-body { padding: 1.5rem; }

/* Inputs */
.form-control, .form-select {
    background-color: var(--input-bg);
    border: 1px solid transparent;
    border-radius: var(--radius-md);
    padding: 0.75rem 1rem;
    font-weight: 500;
    color: var(--text-strong);
    box-shadow: var(--shadow-input);
    transition: 0.2s;
}
.form-control:focus, .form-select:focus {
    background-color: #ffffff;
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(84, 92, 235, 0.1);
}
.form-control::placeholder { color: var(--text-lighter); font-weight: 400; }
.form-label {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
}

/* Layout */
.wrapper { display: flex; width: 100%; min-height: 100vh; }
.sidebar {
    width: var(--sidebar-w);
    min-width: var(--sidebar-w);
    background: var(--surface);
    border-right: 1px solid var(--border-soft);
    z-index: 100;
    display: flex;
    flex-direction: column;
}
.sidebar-brand {
    padding: 1.5rem;
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-strong);
    display: flex;
    align-items: center;
    gap: 0.75rem;
}
.sidebar-logo-icon {
    background: var(--primary);
    color: white;
    width: 36px; height: 36px;
    border-radius: var(--radius-sm);
    display: flex; align-items: center; justify-content: center;
}
.sidebar-nav { list-style: none; padding: 1rem 1rem; margin: 0; }
.sidebar-item { margin-bottom: 0.25rem; }
.sidebar-link {
    display: flex; align-items: center; padding: 0.75rem 1rem;
    color: var(--text-muted); font-weight: 500; border-radius: var(--radius-sm);
    transition: 0.2s; position: relative; gap: 0.75rem;
}
.sidebar-link i { font-size: 1.25rem; }
.sidebar-link:hover { color: var(--text-strong); background: var(--bg-main); }
.sidebar-item.active .sidebar-link {
    color: var(--primary);
    background: rgba(84, 92, 235, 0.05); /* very soft primary */
    font-weight: 600;
}
.sidebar-item.active .sidebar-link::before {
    content: ''; position: absolute; left: -1rem; top: 10%; bottom: 10%;
    width: 3px; background: var(--primary); border-radius: 0 4px 4px 0;
}

/* Main Area */
.main { flex: 1; display: flex; flex-direction: column; overflow: hidden; }
.topbar {
    background: var(--surface);
    height: 4.5rem;
    display: flex;
    align-items: center;
    padding: 0 2rem;
    border-bottom: 1px solid var(--border-soft);
}
.search-wrapper {
    background-color: var(--input-bg);
    border-radius: 99px;
    display: flex;
    align-items: center;
    padding: 0.5rem 1rem;
    width: 100%;
    max-width: 450px;
    margin-left: 1rem;
}
.search-wrapper input {
    border: none; background: transparent; outline: none; box-shadow: none; width: 100%; font-size: 0.875rem;
}
.search-wrapper i { color: var(--text-lighter); margin-right: 0.5rem; }

/* Status Badges */
.badge { padding: 0.35rem 0.75rem; border-radius: 99px; font-weight: 600; font-size: 0.7rem; border: none; }
.badge-status-0 { background: var(--st-new-bg); color: var(--st-new-text); }
.badge-status-1 { background: var(--st-del-bg); color: var(--st-del-text); }
.badge-status-2 { background: var(--st-app-bg); color: var(--st-app-text); }
.badge-status-3 { background: var(--st-dlt-bg); color: var(--st-dlt-text); }
.badge-status-4 { background: var(--st-unr-bg); color: var(--st-unr-text); }
.badge-status-5 { background: var(--st-shp-bg); color: var(--st-shp-text); }
.badge-status-6 { background: var(--st-rtn-bg); color: var(--st-rtn-text); }
.badge-status-7 { background: var(--st-dlv-bg); color: var(--st-dlv-text); }

/* Tables */
.table { margin-bottom: 0; }
.table th {
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-lighter);
    border-bottom: 1px solid var(--border-soft);
    padding: 1rem 1.5rem;
    background: transparent;
    white-space: nowrap;
}
.table td {
    padding: 1rem 1.5rem;
    vertical-align: middle;
    border-bottom: 1px solid var(--border-soft);
    font-weight: 500;
    white-space: nowrap;
}

/* Nav Pills (Figma Table Filter) */
.pill-container {
    background: var(--bg-main);
    border-radius: 99px;
    padding: 0.25rem;
    display: inline-flex;
}
.pill-container .nav-link {
    color: var(--text-muted);
    border-radius: 99px;
    padding: 0.5rem 1.5rem;
    font-weight: 600;
    font-size: 0.85rem;
    border: none;
}
.pill-container .nav-link.active {
    background: #fff;
    color: var(--primary);
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

/* Table Square Action Buttons */
.btn-act {
    width: 30px; height: 30px; border-radius: var(--radius-sm);
    display: inline-flex; align-items: center; justify-content: center;
    border: none; margin-right: 0.25rem; font-size: 0.85rem; transition: 0.2s;
}
.btn-act.act-app { background: var(--st-app-bg); color: var(--st-app-text); }
.btn-act.act-unr { background: var(--st-unr-bg); color: var(--st-unr-text); }
.btn-act.act-del { background: var(--st-del-bg); color: var(--st-del-text); }
.btn-act.act-view { background: var(--st-new-bg); color: var(--st-new-text); }
.btn-act:hover { filter: brightness(0.95); transform: translateY(-1px); }

/* Avatars */
.avatar-md {
    width: 36px; height: 36px;
    border-radius: 50%;
    display: inline-flex; align-items: center; justify-content: center;
    background: var(--bg-main);
    color: var(--primary); font-weight: 700;
    border: 1px solid var(--border-strong);
}

/* Order Totals Dark Card */
.total-card {
    background-color: #111827; /* Dark */
    color: white;
    border-radius: var(--radius-lg);
    box-shadow: 0 10px 25px rgba(17, 24, 39, 0.4);
}

/* Dashboard Motion */
.dashboard-stat-card {
    opacity: 0;
    transform: translateY(14px) scale(0.985);
    transition: transform 0.28s ease, box-shadow 0.28s ease;
    border: 1px solid rgba(255, 255, 255, 0.45);
}

.dashboard-stats-grid.is-ready .dashboard-stat-card {
    animation: dashboardCardIn 0.55s cubic-bezier(.2, .8, .2, 1) forwards;
    animation-delay: var(--stagger-delay, 0ms);
}

.dashboard-stat-card .card-body {
    backdrop-filter: saturate(110%);
}

.dashboard-stat-card .text-muted {
    color: rgba(30, 41, 59, 0.78) !important;
}

.dashboard-stat-card h2,
.dashboard-stat-card .text-dark {
    color: #1f2937 !important;
}

.dashboard-stat-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 14px 28px rgba(15, 23, 42, 0.10) !important;
}

.dashboard-stat-icon {
    position: relative;
    overflow: hidden;
}

.dashboard-stat-icon::after {
    content: "";
    position: absolute;
    top: -140%;
    left: -60%;
    width: 42%;
    height: 300%;
    transform: rotate(22deg);
    background: linear-gradient(to right, transparent, rgba(255, 255, 255, 0.45), transparent);
    animation: dashboardIconShine 4.2s ease-in-out infinite;
}

.dashboard-stat-icon i {
    animation: dashboardIconFloat 2.8s ease-in-out infinite;
}

.dash-tone-1 {
    background: linear-gradient(145deg, #cfe3ff 0%, #bad5ff 100%);
}

.dash-tone-2 {
    background: linear-gradient(145deg, #d9efc7 0%, #c8e6b0 100%);
}

.dash-tone-3 {
    background: linear-gradient(145deg, #d9efc7 0%, #c8e6b0 100%);
}

.dash-tone-4 {
    background: linear-gradient(145deg, #d9efc7 0%, #c8e6b0 100%);
}

.dash-tone-5 {
    background: linear-gradient(145deg, #ffe0b5 0%, #f8cd95 100%);
}

.dash-tone-6 {
    background: linear-gradient(145deg, #ffc9c9 0%, #f5b0b0 100%);
}

.dash-tone-7 {
    background: linear-gradient(145deg, #ffc9c9 0%, #f5b0b0 100%);
}

.dash-tone-8 {
    background: linear-gradient(145deg, #bbd9f2 0%, #a7cce9 100%);
}

.product-color-chip {
    border: 1px solid rgba(15, 23, 42, 0.08);
    font-weight: 700;
    font-size: 0.68rem;
    letter-spacing: 0.02em;
}

.order-color-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    display: inline-block;
    border: 1px solid rgba(15, 23, 42, 0.14);
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.15);
}

.dashboard-pie-wrap {
    position: relative;
    width: 210px;
    height: 210px;
}

.dashboard-pie-chart {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    box-shadow: inset 0 0 0 1px rgba(15, 23, 42, 0.05);
}

.dashboard-pie-center {
    position: absolute;
    inset: 50%;
    width: 88px;
    height: 88px;
    transform: translate(-50%, -50%);
    border-radius: 50%;
    background: #fff;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    box-shadow: 0 6px 18px rgba(15, 23, 42, 0.08);
}

@keyframes dashboardCardIn {
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes dashboardIconFloat {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-2px); }
}

@keyframes dashboardIconShine {
    0%, 70%, 100% { left: -60%; opacity: 0; }
    74% { opacity: 1; }
    86% { left: 130%; opacity: 0; }
}

@media (prefers-reduced-motion: reduce) {
    .dashboard-stat-card,
    .dashboard-stats-grid.is-ready .dashboard-stat-card,
    .dashboard-stat-icon::after,
    .dashboard-stat-icon i {
        animation: none !important;
        transition: none !important;
        transform: none !important;
        opacity: 1 !important;
    }
}

.sidebar-overlay {
    display: none;
}

body.no-scroll {
    overflow: hidden;
}

@media (max-width: 991.98px) {
    .wrapper {
        overflow-x: hidden;
    }

    .sidebar {
        position: fixed;
        top: 0;
        left: 0;
        height: 100vh;
        width: min(86vw, 320px);
        min-width: min(86vw, 320px);
        transform: translateX(-100%);
        transition: transform 0.25s ease;
        z-index: 1045;
        box-shadow: 0 10px 30px rgba(15, 23, 42, 0.18);
    }

    .sidebar.mobile-open {
        transform: translateX(0);
    }

    .sidebar-overlay {
        display: block;
        position: fixed;
        inset: 0;
        background: rgba(15, 23, 42, 0.45);
        opacity: 0;
        visibility: hidden;
        transition: opacity 0.2s ease, visibility 0.2s ease;
        z-index: 1040;
    }

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

    .main {
        width: 100%;
        min-width: 0;
    }

    .topbar {
        height: 4rem;
        padding: 0 0.9rem;
    }

    .content {
        padding: 1rem !important;
    }
}
