/* ===================================================
   Hammadde Sipariş Sistemi - Custom Theme (Light)
   Premium Admin Panel Styles
   =================================================== */

:root {
    /* Color Palette */
    --primary: #4f46e5;
    --primary-light: #6366f1;
    --primary-dark: #4338ca;
    --primary-subtle: #eef2ff;
    --secondary: #64748b;
    --success: #10b981;
    --success-light: #d1fae5;
    --warning: #f59e0b;
    --warning-light: #fef3c7;
    --danger: #ef4444;
    --info: #3b82f6;
    --info-light: #dbeafe;

    /* Neutrals */
    --bg-body: #f1f5f9;
    --bg-white: #ffffff;
    --bg-card: #ffffff;
    --text-primary: #1e293b;
    --text-secondary: #64748b;
    --text-muted: #94a3b8;
    --border-color: #e2e8f0;
    --border-light: #f1f5f9;

    /* Sidebar */
    --sidebar-width: 260px;
    --sidebar-bg: #f8f8f8;
    --sidebar-text: #475569;
    --sidebar-active-bg: rgba(79, 70, 229, 0.15);
    --sidebar-active-text: #4f46e5;
    --sidebar-hover-bg: rgba(0, 0, 0, 0.05);

    /* Shadows */
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.04);
    --shadow: 0 1px 3px rgba(0, 0, 0, 0.06), 0 1px 2px rgba(0, 0, 0, 0.04);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.07), 0 2px 4px -2px rgba(0, 0, 0, 0.05);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.08), 0 4px 6px -4px rgba(0, 0, 0, 0.05);

    /* Transitions */
    --transition-fast: 0.15s ease;
    --transition: 0.25s ease;
    --transition-slow: 0.35s ease;
}

/* ===== Global Styles ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background-color: var(--bg-body);
    color: var(--text-primary);
    font-size: 0.875rem;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

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

a:hover {
    color: var(--primary-dark);
}

/* ===== Scrollbar ===== */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

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

::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

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

.sidebar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: #fff;
    font-size: 1.25rem;
    font-weight: 600;
    letter-spacing: -0.02em;
}

.sidebar-brand i {
    font-size: 1.5rem;
    color: var(--primary-light);
}

.sidebar-brand strong {
    color: var(--primary-light);
}

.sidebar-nav {
    padding: 0.5rem 0;
    flex: 1;
}

.nav-section-title {
    padding: 1.25rem 1.5rem 0.5rem;
    font-size: 0.625rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    color: var(--text-secondary);
    text-transform: uppercase;
}

.sidebar-nav .nav-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.625rem 1.5rem;
    color: var(--sidebar-text);
    font-weight: 500;
    font-size: 0.8125rem;
    border-radius: 0;
    transition: all var(--transition-fast);
    margin: 0 0.75rem;
    border-radius: 0.5rem;
}

.sidebar-nav .nav-link i {
    font-size: 1.125rem;
    width: 1.5rem;
    text-align: center;
}

.sidebar-nav .nav-link:hover {
    color: var(--sidebar-active-text);
    background: var(--sidebar-active-bg);
}

.sidebar-nav .nav-link.active {
    color: var(--sidebar-active-text);
    background: var(--sidebar-active-bg);
}

.sidebar-toggle {
    color: var(--text-secondary);
    border: none;
    padding: 0.375rem 0.5rem;
}

#sidebarClose {
    color: rgba(255, 255, 255, 0.5);
}

#sidebarClose:hover {
    color: #fff;
}

.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1035;
    backdrop-filter: blur(2px);
}

/* ===== Page Wrapper ===== */
.page-wrapper {
    margin-left: var(--sidebar-width);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    transition: margin var(--transition-slow);
}

/* ===== Top Navbar ===== */
.top-navbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.875rem 1.5rem;
    background: var(--bg-white);
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 1020;
    box-shadow: var(--shadow-sm);
}

.page-title {
    font-size: 1.125rem;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: -0.01em;
}

.navbar-actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.user-dropdown {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.375rem 0.75rem;
    border-radius: 0.75rem;
    background: var(--bg-body);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    font-weight: 500;
    font-size: 0.8125rem;
    transition: all var(--transition-fast);
}

.user-dropdown:hover {
    background: var(--border-light);
    border-color: var(--primary-light);
    color: var(--primary);
}

.user-avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 0.75rem;
}

/* ===== Main Content ===== */
.main-content {
    padding: 1.5rem;
    flex: 1;
}

/* ===== Content Card ===== */
.content-card {
    background: var(--bg-card);
    border-radius: 0.875rem;
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow);
    overflow: hidden;
    transition: box-shadow var(--transition);
}

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

.content-card-header {
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--border-light);
    background: linear-gradient(135deg, rgba(79, 70, 229, 0.02), rgba(99, 102, 241, 0.02));
}

.content-card-title {
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0;
}

.content-card-title i {
    color: var(--primary);
}

.content-card-body {
    padding: 1.25rem;
}

/* ===== Stat Cards ===== */
.stat-card {
    background: var(--bg-card);
    border-radius: 0.875rem;
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow);
    overflow: hidden;
    transition: all var(--transition);
    position: relative;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    border-radius: 0.875rem 0.875rem 0 0;
}

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

.stat-card-primary::before { background: linear-gradient(90deg, var(--primary), var(--primary-light)); }
.stat-card-success::before { background: linear-gradient(90deg, #059669, var(--success)); }
.stat-card-warning::before { background: linear-gradient(90deg, #d97706, var(--warning)); }
.stat-card-info::before { background: linear-gradient(90deg, #2563eb, var(--info)); }

.stat-card-body {
    padding: 1.25rem;
    display: flex;
    align-items: flex-start;
    gap: 1rem;
}

.stat-icon {
    width: 48px;
    height: 48px;
    border-radius: 0.75rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.375rem;
    flex-shrink: 0;
}

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

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

.stat-label {
    display: block;
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.stat-value {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--text-primary);
    letter-spacing: -0.02em;
    line-height: 1.2;
    margin-top: 0.125rem;
}

.stat-card-footer {
    padding: 0.625rem 1.25rem;
    border-top: 1px solid var(--border-light);
    background: rgba(241, 245, 249, 0.5);
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.stat-card-footer i {
    opacity: 0.6;
}

/* ===== Tables ===== */
.table {
    font-size: 0.8125rem;
}

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

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

.table-hover tbody tr:hover {
    background-color: rgba(79, 70, 229, 0.02);
}

/* ===== Status Badges ===== */
.badge-status-pending {
    background: rgba(245, 158, 11, 0.1);
    color: #b45309;
    font-weight: 600;
    padding: 0.375rem 0.75rem;
    border-radius: 2rem;
    font-size: 0.75rem;
}

.badge-status-approved {
    background: rgba(59, 130, 246, 0.1);
    color: #1d4ed8;
    font-weight: 600;
    padding: 0.375rem 0.75rem;
    border-radius: 2rem;
    font-size: 0.75rem;
}

.badge-status-production {
    background: rgba(139, 92, 246, 0.1);
    color: #7c3aed;
    font-weight: 600;
    padding: 0.375rem 0.75rem;
    border-radius: 2rem;
    font-size: 0.75rem;
}

.badge-status-completed {
    background: rgba(16, 185, 129, 0.1);
    color: #059669;
    font-weight: 600;
    padding: 0.375rem 0.75rem;
    border-radius: 2rem;
    font-size: 0.75rem;
}

/* ===== Status Filter Tabs ===== */
.status-filter-tabs {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.status-tab {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.5rem 1rem;
    border-radius: 0.625rem;
    background: var(--bg-white);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    font-weight: 500;
    font-size: 0.8125rem;
    transition: all var(--transition-fast);
    text-decoration: none;
}

.status-tab:hover {
    background: var(--primary-subtle);
    border-color: var(--primary-light);
    color: var(--primary);
}

.status-tab.active {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
    box-shadow: 0 2px 8px rgba(79, 70, 229, 0.25);
}

.status-count {
    background: rgba(255, 255, 255, 0.2);
    padding: 0.125rem 0.5rem;
    border-radius: 1rem;
    font-size: 0.6875rem;
    font-weight: 700;
}

/* ===== Forms ===== */
.form-control, .form-select {
    border-radius: 0.625rem;
    border-color: var(--border-color);
    padding: 0.5625rem 0.875rem;
    font-size: 0.8125rem;
    transition: all var(--transition-fast);
}

.form-control:focus, .form-select:focus {
    border-color: var(--primary-light);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

.form-label {
    font-weight: 600;
    font-size: 0.8125rem;
    color: var(--text-primary);
    margin-bottom: 0.375rem;
}

.form-floating .form-control {
    border-radius: 0.75rem;
}

.input-group-text {
    border-radius: 0 0.625rem 0.625rem 0;
    border-color: var(--border-color);
    background: var(--bg-body);
    font-size: 0.8125rem;
    color: var(--text-secondary);
}

/* ===== Buttons ===== */
.btn {
    font-weight: 600;
    font-size: 0.8125rem;
    border-radius: 0.625rem;
    padding: 0.5rem 1rem;
    transition: all var(--transition-fast);
    letter-spacing: 0.01em;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    border: none;
    box-shadow: 0 2px 4px rgba(79, 70, 229, 0.2);
}

.btn-primary:hover {
    background: linear-gradient(135deg, var(--primary-dark), var(--primary));
    box-shadow: 0 4px 12px rgba(79, 70, 229, 0.3);
    transform: translateY(-1px);
}

.btn-lg {
    padding: 0.75rem 1.5rem;
    font-size: 0.9375rem;
    border-radius: 0.75rem;
}

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

.btn-outline-primary:hover {
    background: var(--primary);
    border-color: var(--primary);
    transform: translateY(-1px);
}

.btn-outline-warning {
    border-color: var(--warning);
    color: #b45309;
}

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

/* ===== Alerts ===== */
.alert {
    border: none;
    border-radius: 0.75rem;
    font-size: 0.8125rem;
    font-weight: 500;
    box-shadow: var(--shadow-sm);
}

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

.alert-danger {
    background: #fef2f2;
    color: #991b1b;
}

/* ===== Calculation Panel ===== */
.calc-row {
    margin-bottom: 0.5rem;
}

.calc-value {
    font-size: 1.125rem;
    font-weight: 700;
    color: var(--text-primary);
}

.calc-value-lg {
    font-size: 1.375rem;
    color: var(--text-primary);
}

.calc-total-row {
    padding: 0.75rem;
    background: var(--bg-body);
    border-radius: 0.625rem;
    margin-top: 0.5rem;
}

.calc-input {
    font-weight: 600;
}

.final-total-box {
    padding: 1rem;
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    border-radius: 0.875rem;
    color: #fff;
    box-shadow: 0 4px 15px rgba(79, 70, 229, 0.3);
}

.final-total-value {
    font-size: 1.5rem;
    font-weight: 800;
    letter-spacing: -0.02em;
}

/* ===== Detail Labels ===== */
.detail-label {
    font-size: 0.6875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    margin-bottom: 0.25rem;
}

.detail-value {
    font-size: 0.9375rem;
    font-weight: 500;
    color: var(--text-primary);
}

/* ===== Login Page ===== */
.login-page {
    min-height: 100vh;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.login-container {
    width: 100%;
    max-width: 420px;
}

.login-card {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    border-radius: 1.25rem;
    padding: 2.5rem;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.3);
}

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

.login-logo {
    width: 64px;
    height: 64px;
    border-radius: 1rem;
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1rem;
    color: #fff;
    font-size: 1.75rem;
    box-shadow: 0 8px 25px rgba(79, 70, 229, 0.3);
}

.login-header h2 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
}

.login-header h2 strong {
    color: var(--primary);
}

.login-form .form-floating {
    margin-bottom: 1rem;
}

.login-form .form-floating .form-control {
    height: 3.25rem;
    border-radius: 0.75rem;
}

.btn-login {
    height: 3rem;
    font-size: 1rem;
    border-radius: 0.75rem;
}

.login-footer {
    text-align: center;
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border-light);
}

/* ===== Dropdown ===== */
.dropdown-menu {
    border-radius: 0.75rem;
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-lg);
    padding: 0.5rem;
}

.dropdown-item {
    border-radius: 0.5rem;
    font-size: 0.8125rem;
    padding: 0.5rem 0.75rem;
}

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

.stat-card,
.content-card {
    animation: fadeInUp 0.4s ease;
}

.stat-card:nth-child(2) { animation-delay: 0.05s; }
.stat-card:nth-child(3) { animation-delay: 0.1s; }
.stat-card:nth-child(4) { animation-delay: 0.15s; }

/* ===== Material Row Animation ===== */
.material-row {
    animation: fadeInUp 0.3s ease;
}

.material-row .btn-remove {
    opacity: 0.5;
    transition: all var(--transition-fast);
}

.material-row:hover .btn-remove {
    opacity: 1;
}

/* ===== Responsive ===== */
@media (max-width: 991.98px) {
    .sidebar {
        transform: translateX(-100%);
    }

    .sidebar.show {
        transform: translateX(0);
    }

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

    .page-wrapper {
        margin-left: 0;
    }

    .main-content {
        padding: 1rem;
    }

    .stat-value {
        font-size: 1.25rem;
    }
}

@media (max-width: 575.98px) {
    .login-card {
        padding: 1.5rem;
    }

    .status-filter-tabs {
        overflow-x: auto;
        flex-wrap: nowrap;
        -webkit-overflow-scrolling: touch;
        padding-bottom: 0.5rem;
    }

    .status-tab {
        white-space: nowrap;
        font-size: 0.75rem;
        padding: 0.375rem 0.75rem;
    }

    .top-navbar {
        padding: 0.75rem 1rem;
    }

    .table {
        font-size: 0.75rem;
    }

    .final-total-value {
        font-size: 1.25rem;
    }
}