/* ===== BAUN VYS - Kurumsal Minimal Tema ===== */

:root {
    --vys-bg: #f5f6fa;
    --vys-surface: #ffffff;
    --vys-border: #e2e5e9;
    --vys-text: #1a1d21;
    --vys-muted: #6b7280;
    --vys-accent: #1e40af;
    --vys-accent-hover: #1e3a8a;
    --vys-nav-bg: #111827;

    --bs-body-font-family: 'Inter', -apple-system, 'Segoe UI', sans-serif;
    --bs-body-font-size: 0.875rem;
    --bs-body-color: var(--vys-text);
    --bs-body-bg: var(--vys-bg);
    --bs-border-color: var(--vys-border);

    --bs-primary: #2563eb;
    --bs-primary-rgb: 37, 99, 235;
    --bs-secondary: #6b7280;
    --bs-secondary-rgb: 107, 114, 128;
    --bs-success: #059669;
    --bs-success-rgb: 5, 150, 105;
    --bs-danger: #dc2626;
    --bs-danger-rgb: 220, 38, 38;
    --bs-warning: #d97706;
    --bs-warning-rgb: 217, 119, 6;
    --bs-info: #0891b2;
    --bs-info-rgb: 8, 145, 178;
    --bs-dark: #111827;
    --bs-dark-rgb: 17, 24, 39;
}

body {
    min-height: 100vh;
    background: var(--vys-bg);
    color: var(--vys-text);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body.app-shell {
    display: flex;
    flex-direction: column;
}

h1, h2, h3, h4, h5, h6 {
    font-weight: 600;
    color: var(--vys-text);
}

h1.h4 {
    font-size: 1.25rem;
    font-weight: 700;
    color: #111827;
    margin-bottom: 1.25rem;
}

/* ===== Sidebar & Layout ===== */

.app-wrapper {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: 260px;
    background: var(--vys-nav-bg) !important;
    color: #fff;
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    transition: transform 0.3s ease;
    z-index: 1045;
    position: sticky;
    top: 0;
    height: 100vh;
}

.sidebar-header {
    padding: 1rem 1.25rem;
    font-size: 1.1rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.sidebar-header a {
    color: #fff;
    text-decoration: none;
}

.sidebar .nav-link {
    color: rgba(255, 255, 255, 0.75);
    font-size: 0.875rem;
    font-weight: 500;
    padding: 0.65rem 1.25rem;
    border-radius: 0;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
}

.sidebar .nav-link i {
    width: 20px;
    margin-right: 10px;
    font-size: 1.1rem;
}

.sidebar .nav-link:hover,
.sidebar .nav-link:focus-visible {
    color: #fff;
    background: rgba(255, 255, 255, 0.08);
}

/* Sidebar Custom Scrollbar */
.sidebar-body::-webkit-scrollbar {
    width: 6px;
}
.sidebar-body::-webkit-scrollbar-track {
    background: transparent;
}
.sidebar-body::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 10px;
}
.sidebar-body::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.4);
}

.sidebar .nav-link.active {
    color: #fff;
    background: rgba(255, 255, 255, 0.15);
    border-left: 4px solid var(--bs-primary);
    padding-left: calc(1.25rem - 4px);
    font-weight: 600;
}

.sidebar-footer {
    padding: 1rem 1.25rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(0, 0, 0, 0.15);
}

.sidebar-footer .user-name {
    font-size: 0.85rem;
    font-weight: 600;
    color: #fff;
    margin-bottom: 0.2rem;
}

.sidebar-footer .user-role {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.6);
}

.mobile-topbar {
    display: none;
    background: var(--vys-nav-bg);
    color: #fff;
    padding: 0.75rem 1rem;
    align-items: center;
    justify-content: space-between;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12);
    position: sticky;
    top: 0;
    z-index: 1040;
}

.mobile-topbar .navbar-brand {
    color: #fff;
    font-weight: 700;
    text-decoration: none;
    font-size: 1rem;
}

.main-content {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
}

main.container-fluid {
    max-width: 1400px;
    padding: 2rem;
    flex: 1;
}

/* ===== Cards ===== */

.card,
.kpi-card {
    background: var(--vys-surface);
    border: 1px solid var(--vys-border);
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.kpi-card .fs-4 {
    line-height: 1.2;
}

.card-header {
    background: #fafbfc !important;
    border-bottom: 1px solid var(--vys-border);
    font-weight: 600;
    font-size: 0.875rem;
    padding: 0.75rem 1rem;
}

.card-body {
    padding: 1rem;
}

.card-footer {
    background: #fafbfc;
    border-top: 1px solid var(--vys-border);
}

/* ===== Tables ===== */

.table > :not(caption) > * > * {
    border-bottom-color: var(--vys-border);
    padding: 0.625rem 0.75rem;
}

.table thead th {
    white-space: nowrap;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--vys-muted);
    font-weight: 600;
    border-bottom-width: 2px;
    background: #fafbfc;
}

.table-hover > tbody > tr:hover > * {
    background-color: #f0f4ff;
}

/* ===== Forms ===== */

.form-control,
.form-select {
    border-radius: 6px;
    border-color: #d1d5db;
    font-size: 0.875rem;
    background-color: #fff;
}

.form-control:focus,
.form-select:focus {
    border-color: var(--vys-accent);
    box-shadow: 0 0 0 3px rgba(30, 64, 175, 0.1);
}

.form-label {
    font-size: 0.8125rem;
    font-weight: 500;
    color: #374151;
    margin-bottom: 0.25rem;
}

.form-control-sm,
.form-select-sm {
    font-size: 0.8125rem;
}

/* ===== Buttons ===== */

.btn {
    border-radius: 6px;
    font-weight: 500;
    font-size: 0.875rem;
    letter-spacing: 0;
    padding: 0.4rem 0.85rem;
}

.btn-sm {
    font-size: 0.8125rem;
    padding: 0.25rem 0.6rem;
}

.btn-dark {
    --bs-btn-color: #fff;
    --bs-btn-bg: #111827;
    --bs-btn-border-color: #111827;
    --bs-btn-hover-color: #fff;
    --bs-btn-hover-bg: #1f2937;
    --bs-btn-hover-border-color: #1f2937;
    --bs-btn-active-bg: #030712;
    --bs-btn-active-border-color: #030712;
}

.btn-outline-dark {
    --bs-btn-color: #374151;
    --bs-btn-border-color: #d1d5db;
    --bs-btn-hover-color: #fff;
    --bs-btn-hover-bg: #111827;
    --bs-btn-hover-border-color: #111827;
}

.btn-outline-primary {
    --bs-btn-color: #2563eb;
    --bs-btn-border-color: #2563eb;
    --bs-btn-hover-color: #fff;
    --bs-btn-hover-bg: #2563eb;
    --bs-btn-hover-border-color: #2563eb;
}

/* ===== Alerts ===== */

.alert {
    border-radius: 8px;
    border: 1px solid;
    font-size: 0.875rem;
}

/* ===== Badges ===== */

.badge {
    font-weight: 500;
    letter-spacing: 0.01em;
    font-size: 0.75rem;
}

/* ===== Action Buttons ===== */

.btn-group form.d-inline {
    display: contents;
}

.table td .btn-group .btn {
    white-space: nowrap;
}

/* ===== Utility ===== */

.text-muted {
    color: var(--vys-muted) !important;
}

/* ===== Login ===== */

.login-screen {
    display: grid;
    place-items: center;
    padding: 2rem 1rem;
}

.login-card {
    width: min(420px, 100%);
    border: 1px solid var(--vys-border);
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    background: #fff;
}

.login-card .card-body {
    padding: 2rem;
}

.login-card hr {
    border-color: var(--vys-border);
}

.login-card .btn {
    padding: 0.55rem 1rem;
}

/* ===== Pagination ===== */

.pagination .page-link {
    font-size: 0.8125rem;
    color: #374151;
    border-color: var(--vys-border);
}

.pagination .page-item.active .page-link {
    background-color: #111827;
    border-color: #111827;
}

/* ===== Responsive ===== */

@media (max-width: 991.98px) {
    .mobile-topbar {
        display: flex;
    }
    
    /* Offcanvas usage overrides sidebar width/transform when open */
    .sidebar {
        position: fixed;
        top: 0;
        left: -260px; /* Hidden by default if not using pure offcanvas, but we will use bootstrap offcanvas classes */
        height: 100vh;
        z-index: 1050;
    }
    
    .sidebar.show {
        left: 0;
    }

    main.container-fluid {
        padding-left: 1rem;
        padding-right: 1rem;
        padding-top: 1.5rem;
    }
}
