/* =========================================================
   SATIŞ & STOK ERP - PREMIUM DESIGN SYSTEM (DARK MODE)
   ========================================================= */

:root {
    /* Color Palette - Rich Dark Mode */
    --bg-base: #0a0a0b;
    --bg-surface: #141518;
    --bg-surface-elevated: #1e1f24;
    --bg-surface-hover: #26282e;
    
    --text-primary: #f0f0f5;
    --text-secondary: #9ea1ad;
    --text-muted: #6b6e79;

    --primary: #4f46e5;       /* Indigo 600 */
    --primary-hover: #6366f1; /* Indigo 500 */
    --primary-glow: rgba(79, 70, 229, 0.4);

    --success: #10b981;
    --success-bg: rgba(16, 185, 129, 0.15);
    
    --warning: #f59e0b;
    --warning-bg: rgba(245, 158, 11, 0.15);
    
    --danger: #ef4444;
    --danger-bg: rgba(239, 68, 68, 0.15);

    --border: #26282e;
    --border-light: rgba(255, 255, 255, 0.05);

    /* Typography */
    --font-sans: 'Outfit', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    
    /* Shadows & Effects */
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.4), 0 2px 4px -1px rgba(0, 0, 0, 0.2);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.4), 0 4px 6px -2px rgba(0, 0, 0, 0.2);
    
    --transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 16px;
}

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

body {
    font-family: var(--font-sans);
    background-color: var(--bg-base);
    color: var(--text-primary);
    -webkit-font-smoothing: antialiased;
    line-height: 1.5;
    overflow-x: hidden;
}

a {
    text-decoration: none;
    color: inherit;
}

button, input {
    font-family: inherit;
    border: none;
    outline: none;
}

/* =========================================================
   TYPOGRAPHY & UTILITIES
   ========================================================= */
h1, h2, h3, h4, h5 {
    font-weight: 600;
    letter-spacing: -0.02em;
    color: var(--text-primary);
}

.text-muted { color: var(--text-muted); }
.text-success { color: var(--success); }
.text-danger { color: var(--danger); }

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 18px;
    border-radius: var(--radius-md);
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
}

.btn-primary {
    background: var(--primary);
    color: white;
    box-shadow: 0 0 12px var(--primary-glow);
}

.btn-primary:hover {
    background: var(--primary-hover);
    transform: translateY(-1px);
    box-shadow: 0 4px 15px var(--primary-glow);
}

.btn-ghost {
    background: transparent;
    color: var(--text-secondary);
}

.btn-ghost:hover {
    background: var(--bg-surface-hover);
    color: var(--text-primary);
}

.btn-block {
    width: 100%;
}

.icon-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--bg-surface);
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition);
    border: 1px solid var(--border);
}

.icon-btn:hover {
    background: var(--bg-surface-hover);
    color: var(--text-primary);
}

/* Badges */
.badge {
    padding: 2px 8px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    background: var(--border);
    color: var(--text-secondary);
}

.badge.warning { background: var(--warning-bg); color: var(--warning); }
.badge.danger { background: var(--danger-bg); color: var(--danger); }

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

.form-group label {
    display: block;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.input-icon {
    position: relative;
    display: flex;
    align-items: center;
}

.input-icon i {
    position: absolute;
    left: 14px;
    color: var(--text-muted);
    font-size: 1.1rem;
}

.input-icon input {
    width: 100%;
    background: var(--bg-surface-elevated);
    border: 1px solid var(--border);
    color: var(--text-primary);
    padding: 12px 14px 12px 40px;
    border-radius: var(--radius-md);
    font-size: 0.95rem;
    transition: var(--transition);
}

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

/* =========================================================
   VIEW MANAGEMENT
   ========================================================= */
.view-container {
    display: none;
    height: 100vh;
    width: 100vw;
}

.view-container.active {
    display: flex;
}

/* =========================================================
   LOGIN SCREEN (sade giriş)
   ========================================================= */
#login-view.active {
    display: flex;
    align-items: center;
    justify-content: center;
}

.login-page {
    width: 100%;
    min-height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background:
        radial-gradient(ellipse 80% 50% at 50% -20%, rgba(79, 70, 229, 0.12), transparent),
        var(--bg-base);
}

.login-card {
    width: 100%;
    max-width: 400px;
    padding: 40px 36px 32px;
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: 20px;
    box-shadow: var(--shadow-lg);
}

.login-brand {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-bottom: 8px;
}

.login-brand-name {
    font-size: 1.5rem;
    font-weight: 600;
    letter-spacing: -0.03em;
}

.login-brand .brand-icon {
    font-size: 1.75rem;
    color: var(--primary);
}

.login-tagline {
    text-align: center;
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-bottom: 28px;
}

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

.login-form label {
    display: block;
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 6px;
}

.login-input {
    width: 100%;
    padding: 12px 14px;
    background: var(--bg-base);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 0.95rem;
    transition: var(--transition);
}

.login-input::placeholder {
    color: var(--text-muted);
}

.login-input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.12);
}

.login-submit {
    margin-top: 8px;
    padding: 12px;
    font-size: 0.95rem;
    box-shadow: none;
}

.login-submit:hover {
    box-shadow: 0 4px 12px var(--primary-glow);
}

.login-footnote {
    margin-top: 24px;
    text-align: center;
    font-size: 0.75rem;
    color: var(--text-muted);
}

.error-msg {
    margin-top: 14px;
    padding: 10px 12px;
    background: var(--danger-bg);
    color: var(--danger);
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    text-align: center;
    border: 1px solid rgba(239, 68, 68, 0.25);
}

.brand {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--text-primary);
}

.brand-icon {
    color: var(--primary);
    font-size: 1.8rem;
}

/* =========================================================
   APP SHELL (ADMIN PANEL)
   ========================================================= */
#app-view {
    background: var(--bg-base);
}

/* Sidebar */
.sidebar {
    width: 260px;
    background: var(--bg-surface);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    height: 100vh;
}

.sidebar-header {
    height: 70px;
    display: flex;
    align-items: center;
    padding: 0 24px;
    border-bottom: 1px solid var(--border);
}

.user-profile {
    padding: 24px;
    display: flex;
    align-items: center;
    gap: 15px;
    border-bottom: 1px solid var(--border);
}

.avatar {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-sm);
    background: linear-gradient(135deg, var(--primary) 0%, #312e81 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    color: white;
    font-size: 0.9rem;
}

.user-info h5 {
    font-size: 0.95rem;
    margin-bottom: 2px;
}

.sidebar-nav {
    flex: 1;
    overflow-y: auto;
    padding: 20px 12px;
}

.nav-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.nav-label {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    font-weight: 600;
    margin: 15px 0 5px 12px;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    font-size: 0.9rem;
    font-weight: 500;
    transition: var(--transition);
}

.nav-link i {
    font-size: 1.2rem;
}

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

.nav-link.active {
    background: rgba(79, 70, 229, 0.1);
    color: var(--primary);
}

.nav-link .badge {
    margin-left: auto;
}

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

/* Main Content */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    height: 100vh;
    overflow: hidden;
}

.topbar {
    height: 70px;
    background: rgba(20, 21, 24, 0.8);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 30px;
    z-index: 10;
}

.page-title {
    font-size: 1.2rem;
    font-weight: 600;
}

.content-body {
    flex: 1;
    overflow-y: auto;
    padding: 30px;
}

/* =========================================================
   DASHBOARD COMPONENTS
   ========================================================= */
.dash-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 24px;
    display: flex;
    align-items: flex-start;
    gap: 16px;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

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

.stat-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
}

.stat-icon.blue { background: rgba(59, 130, 246, 0.1); color: #3b82f6; }
.stat-icon.purple { background: rgba(168, 85, 247, 0.1); color: #a855f7; }
.stat-icon.green { background: rgba(16, 185, 129, 0.1); color: #10b981; }
.stat-icon.orange { background: rgba(245, 158, 11, 0.1); color: #f59e0b; }
.stat-icon.red { background: rgba(239, 68, 68, 0.1); color: #ef4444; }

.stat-info h3 {
    font-size: 1.8rem;
    margin-bottom: 4px;
}

.stat-info p {
    color: var(--text-secondary);
    font-size: 0.85rem;
    font-weight: 500;
}

/* Recent Uploads Table */
.card {
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    overflow: hidden;
}

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

.card-header h3 {
    font-size: 1.1rem;
}

.table-responsive {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
}

th {
    text-align: left;
    padding: 16px 24px;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    font-weight: 600;
    border-bottom: 1px solid var(--border);
    background: rgba(255,255,255,0.01);
}

td {
    padding: 16px 24px;
    font-size: 0.9rem;
    border-bottom: 1px solid var(--border);
    color: var(--text-secondary);
}

tbody tr:last-child td {
    border-bottom: none;
}

tbody tr:hover td {
    background: rgba(255,255,255,0.02);
    color: var(--text-primary);
}

.status-badge {
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.status-badge.completed { background: var(--success-bg); color: var(--success); }
.status-badge.pending { background: rgba(59, 130, 246, 0.15); color: #3b82f6; }
.status-badge.processing { background: var(--warning-bg); color: var(--warning); }
.status-badge.failed { background: var(--danger-bg); color: var(--danger); }

/* Loader */
.loader-container {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    min-height: 200px;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid rgba(79, 70, 229, 0.2);
    border-radius: 50%;
    border-top-color: var(--primary);
    animation: spin 1s ease-in-out infinite;
}

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