/* ============================================================
   MyERP - Professional ERP Application Styles
   ============================================================ */

:root {
    --sidebar-width: 260px;
    --sidebar-collapsed-width: 0px;
    --topbar-height: 60px;
    --primary: #2563eb;
    --primary-dark: #1d4ed8;
    --sidebar-bg: #0f172a;
    --sidebar-text: #cbd5e1;
    --sidebar-active: #2563eb;
    --sidebar-hover: rgba(255,255,255,0.08);
    --content-bg: #f1f5f9;
    --card-shadow: 0 1px 3px rgba(0,0,0,.1), 0 1px 2px rgba(0,0,0,.06);
    --card-shadow-hover: 0 10px 15px -3px rgba(0,0,0,.1), 0 4px 6px -2px rgba(0,0,0,.05);
}

* { box-sizing: border-box; }

body.erp-body {
    margin: 0;
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    background: var(--content-bg);
    display: flex;
    min-height: 100vh;
}

/* ─── Sidebar ─────────────────────────────────────────────── */
.erp-sidebar {
    width: var(--sidebar-width);
    min-height: 100vh;
    background: var(--sidebar-bg);
    position: fixed;
    top: 0; left: 0;
    z-index: 1000;
    transition: transform 0.3s ease;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    overflow-x: hidden;
}

.sidebar-header {
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid rgba(255,255,255,0.08);
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    background: var(--sidebar-bg);
    z-index: 10;
}

.brand-logo {
    display: flex;
    align-items: center;
    color: #fff;
    font-size: 1.25rem;
    font-weight: 700;
    letter-spacing: 0.5px;
}

.brand-logo i { color: var(--primary); font-size: 1.4rem; }
.brand-name { color: #fff; }

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

.sidebar-nav .nav-link {
    color: var(--sidebar-text);
    padding: 0.6rem 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    border-radius: 0;
    font-size: 0.875rem;
    transition: all 0.2s;
    white-space: nowrap;
    border-left: 3px solid transparent;
}

.sidebar-nav .nav-link i {
    width: 18px;
    text-align: center;
    font-size: 0.9rem;
    flex-shrink: 0;
    opacity: 0.8;
}

.sidebar-nav .nav-link:hover {
    background: var(--sidebar-hover);
    color: #fff;
}

.sidebar-nav .nav-link.active {
    background: rgba(37, 99, 235, 0.15);
    color: #fff;
    border-left-color: var(--primary);
    font-weight: 600;
}

.sidebar-nav .nav-link.active i { opacity: 1; color: var(--primary); }

.nav-section-title {
    padding: 1rem 1.5rem 0.35rem;
    font-size: 0.65rem;
    font-weight: 700;
    letter-spacing: 1px;
    color: #475569;
    text-transform: uppercase;
}

/* ─── Main Layout ─────────────────────────────────────────── */
.erp-main {
    margin-left: var(--sidebar-width);
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    transition: margin-left 0.3s ease;
}

.erp-topbar {
    height: var(--topbar-height);
    background: #fff;
    border-bottom: 1px solid #e2e8f0;
    padding: 0 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 1px 3px rgba(0,0,0,.05);
}

.erp-content {
    padding: 1.5rem;
    flex: 1;
}

/* ─── Cards ───────────────────────────────────────────────── */
.erp-card {
    background: #fff;
    border-radius: 12px;
    box-shadow: var(--card-shadow);
    border: 1px solid #e2e8f0;
    transition: box-shadow 0.2s;
    overflow: hidden;
}

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

.erp-card-header {
    padding: 1rem 1.25rem;
    border-bottom: 1px solid #f1f5f9;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: #fafafa;
}

.erp-card-header h5, .erp-card-header h6 {
    margin: 0;
    font-weight: 600;
    color: #1e293b;
}

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

/* ─── Stat Cards ──────────────────────────────────────────── */
.stat-card {
    background: #fff;
    border-radius: 12px;
    padding: 1.25rem;
    box-shadow: var(--card-shadow);
    border: 1px solid #e2e8f0;
    display: flex;
    align-items: center;
    gap: 1rem;
    transition: transform 0.2s, box-shadow 0.2s;
}

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

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

.stat-info .stat-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: #1e293b;
    line-height: 1;
    margin-bottom: 0.2rem;
}

.stat-info .stat-label {
    font-size: 0.8rem;
    color: #64748b;
    font-weight: 500;
}

/* ─── Buttons ─────────────────────────────────────────────── */
.btn-erp-primary {
    background: var(--primary);
    color: #fff;
    border: none;
    padding: 0.5rem 1.25rem;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.875rem;
    transition: all 0.2s;
}

.btn-erp-primary:hover { background: var(--primary-dark); color: #fff; transform: translateY(-1px); }

/* ─── Tables ──────────────────────────────────────────────── */
.erp-table {
    font-size: 0.875rem;
}

.erp-table thead th {
    background: #f8fafc;
    color: #475569;
    font-weight: 600;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 2px solid #e2e8f0;
    padding: 0.75rem 1rem;
    white-space: nowrap;
}

.erp-table tbody tr { transition: background 0.15s; }
.erp-table tbody tr:hover { background: #f8fafc; }
.erp-table tbody td { padding: 0.75rem 1rem; vertical-align: middle; border-color: #f1f5f9; }

/* ─── Badges / Status ─────────────────────────────────────── */
.badge-status {
    padding: 0.3rem 0.65rem;
    border-radius: 20px;
    font-size: 0.72rem;
    font-weight: 600;
}

.badge-taslak { background: #f1f5f9; color: #475569; }
.badge-onaylandi { background: #dbeafe; color: #1d4ed8; }
.badge-islemde { background: #fef3c7; color: #92400e; }
.badge-tamamlandi { background: #d1fae5; color: #065f46; }
.badge-iptal { background: #fee2e2; color: #991b1b; }
.badge-gecikti { background: #fee2e2; color: #991b1b; }
.badge-odendi { background: #d1fae5; color: #065f46; }

/* ─── Forms ───────────────────────────────────────────────── */
.form-label {
    font-size: 0.82rem;
    font-weight: 600;
    color: #374151;
    margin-bottom: 0.3rem;
}

.form-control, .form-select {
    border-color: #d1d5db;
    border-radius: 8px;
    font-size: 0.875rem;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.form-control:focus, .form-select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

/* ─── Page Header ─────────────────────────────────────────── */
.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.5rem;
}

.page-title {
    font-size: 1.35rem;
    font-weight: 700;
    color: #1e293b;
    margin: 0;
}

.page-subtitle {
    font-size: 0.85rem;
    color: #64748b;
    margin: 0.2rem 0 0;
}

/* ─── Login Page ──────────────────────────────────────────── */
.login-wrapper {
    min-height: 100vh;
    background: linear-gradient(135deg, #0f172a 0%, #1e3a8a 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.login-card {
    background: #fff;
    border-radius: 16px;
    padding: 2.5rem;
    width: 100%;
    max-width: 420px;
    box-shadow: 0 25px 50px -12px rgba(0,0,0,.4);
}

.login-logo {
    text-align: center;
    margin-bottom: 1.75rem;
}

.login-logo .logo-icon {
    width: 64px; height: 64px;
    background: linear-gradient(135deg, #2563eb, #1d4ed8);
    border-radius: 16px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.75rem;
    color: #fff;
    margin-bottom: 0.75rem;
}

.login-logo h4 { font-weight: 700; color: #1e293b; margin: 0; }
.login-logo p { color: #64748b; font-size: 0.875rem; margin: 0.2rem 0 0; }

/* ─── Sidebar Toggle ──────────────────────────────────────── */
.sidebar-collapsed .erp-sidebar { transform: translateX(calc(-1 * var(--sidebar-width))); }
.sidebar-collapsed .erp-main { margin-left: 0; }

/* ─── Responsive ──────────────────────────────────────────── */
@media (max-width: 768px) {
    .erp-sidebar { transform: translateX(calc(-1 * var(--sidebar-width))); }
    .erp-sidebar.mobile-open { transform: translateX(0); }
    .erp-main { margin-left: 0; }
    .erp-content { padding: 1rem; }
}

/* ─── Invoice line rows ───────────────────────────────────── */
.line-row { background: #f8fafc; border-radius: 8px; padding: 0.75rem; margin-bottom: 0.5rem; border: 1px solid #e2e8f0; }

/* ─── Scrollbar ───────────────────────────────────────────── */
.erp-sidebar::-webkit-scrollbar { width: 4px; }
.erp-sidebar::-webkit-scrollbar-track { background: transparent; }
.erp-sidebar::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.15); border-radius: 4px; }
