/* CSS başlangıç dosyası */

body {
    font-size: 13px;
    /* Ana font boyutu 13px */
    color: #4c5258;
    letter-spacing: 0.5px;
    background-color: #f7f7ff;
    font-family: 'Roboto', sans-serif;
    background: var(--main-bg);
    transition: all 0.3s ease;
}

/* =================
   ERP THEME VARIABLES
   ================= */

:root {
    --sidebar-width: 250px;
    --sidebar-collapsed-width: 80px;
    --header-height: 60px;
}

/* Theme Variables */
[data-bs-theme="light"] {
    --sidebar-bg: #fff;
    --sidebar-border: #e9ecef;
    --sidebar-text: #495057;
    --sidebar-text-hover: #0d6efd;
    --sidebar-active-bg: #e7f1ff;
    --sidebar-active-text: #0d6efd;
    --header-bg: #fff;
    --header-border: #e9ecef;
    --header-text: #495057;
    --main-bg: #f8f9fa;
    --dropdown-bg: #fff;
    --dropdown-border: #e9ecef;
    --dropdown-text: #495057;
    --dropdown-hover-bg: #f8f9fa;
    --dropdown-hover-text: #0d6efd;
}

[data-bs-theme="dark"] {
    --sidebar-bg: #212529;
    --sidebar-border: #495057;
    --sidebar-text: #adb5bd;
    --sidebar-text-hover: #fff;
    --sidebar-active-bg: #495057;
    --sidebar-active-text: #fff;
    --header-bg: #212529;
    --header-border: #495057;
    --header-text: #adb5bd;
    --main-bg: #343a40;
    --dropdown-bg: #212529;
    --dropdown-border: #495057;
    --dropdown-text: #adb5bd;
    --dropdown-hover-bg: #495057;
    --dropdown-hover-text: #fff;
}

/* =================
   GLOBAL FONT SIZE ADJUSTMENTS
   ================= */

/* Global font size adjustments */
.table {
    font-size: 12px;
    /* Tablolar için daha küçük font */
}

.table th,
.table td {
    padding: 0.4rem 0.6rem;
    /* Tablo hücre padding'ini daha da küçült */
    font-size: 12px;
    line-height: 1.3;
}

.table-sm th,
.table-sm td {
    padding: 0.2rem 0.4rem;
    font-size: 11px;
}

.form-control,
.form-select,
.btn {
    font-size: 12px;
    /* Form elemanları için daha küçük font */
}

.btn-sm {
    font-size: 11px;
    padding: 0.2rem 0.4rem;
}

.card-body {
    font-size: 12px;
    /* Kart içerikleri için daha küçük font */
}

.modal-body {
    font-size: 12px;
    /* Modal içerikleri için daha küçük font */
}

.nav-link {
    font-size: 12px;
    /* Navigasyon linkleri daha küçük */
    transition: all 0.2s ease;
    border-radius: 6px;
    margin-bottom: 2px;
}

.dropdown-item {
    font-size: 12px;
    /* Dropdown öğeleri */
    padding: 0.3rem 0.8rem;
}

.badge {
    font-size: 10px;
    /* Badge'ler için daha küçük */
}

.text-sm {
    font-size: 11px !important;
}

.text-xs {
    font-size: 10px !important;
}

.form-label {
    font-size: 12px;
    /* Form etiketleri */
    margin-bottom: 0.3rem;
}

.card-title {
    font-size: 14px;
    /* Kart başlıkları */
}

.breadcrumb-item {
    font-size: 12px;
}

.modal-title {
    font-size: 15px;
}

.alert {
    font-size: 12px;
    padding: 0.5rem 0.75rem;
}

.status-dot {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 50%;
}

/* Header specific font adjustments */
.header-actions {
    font-size: 12px;
}

.dropdown-header {
    color: var(--dropdown-text) !important;
    font-size: 11px !important;
    font-weight: 600;
    text-transform: uppercase;
}

.nav-text {
    font-size: 12px;
}

.sidebar .nav-text {
    font-size: 12px;
    white-space: nowrap;
    overflow: hidden;
}

.sidebar.collapsed .nav-text {
    display: none;
}

/* Breadcrumb styling */
.page-breadcrumb {
    font-size: 12px;
}

.page-title {
    font-size: 18px !important;
    font-weight: 600;
}

/* User menu styling */
.user-name {
    font-size: 12px;
    font-weight: 500;
}

.user-role {
    font-size: 10px;
    opacity: 0.7;
}

/* =================
   SIDEBAR & HEADER LAYOUT
   ================= */

/* Top Header */
.top-header {
    position: fixed;
    top: 0;
    right: 0;
    left: var(--sidebar-width);
    height: var(--header-height);
    background: var(--header-bg);
    border-bottom: 1px solid var(--header-border);
    z-index: 1030;
    transition: left 0.3s ease;
    padding: 0 20px;
}

.top-header.collapsed {
    left: var(--sidebar-collapsed-width);
}

/* Sidebar */
.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: var(--sidebar-width);
    height: 100vh;
    background: var(--sidebar-bg);
    border-right: 1px solid var(--sidebar-border);
    z-index: 1040;
    transition: width 0.3s ease;
    overflow: hidden;
}

.sidebar.collapsed {
    width: var(--sidebar-collapsed-width);
}

.sidebar-header {
    height: var(--header-height);
    padding: 0 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--sidebar-border);
}

.sidebar.collapsed .sidebar-header {
    padding: 0 10px;
    justify-content: center;
}

.sidebar.collapsed .sidebar-brand-text {
    display: none;
}

.sidebar-toggle {
    background: none;
    border: none;
    color: var(--sidebar-text);
    font-size: 1.2rem;
    cursor: pointer;
    padding: 5px;
    border-radius: 5px;
}

.sidebar-toggle:hover {
    color: var(--sidebar-text-hover);
}

.sidebar-nav {
    padding: 20px 0;
    height: calc(100vh - var(--header-height));
    overflow-y: auto;
}

.nav-section {
    margin-bottom: 30px;
}

.nav-section-title {
    font-size: 0.7rem;
    /* Daha küçük section başlıkları */
    font-weight: 600;
    color: var(--sidebar-text);
    opacity: 0.7;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 10px;
    padding: 0 20px;
    transition: all 0.3s ease;
    white-space: nowrap;
    overflow: hidden;
}

.sidebar.collapsed .nav-section-title {
    opacity: 0;
    height: 0;
    margin: 0;
    padding: 0;
    overflow: hidden;
    font-size: 0;
}

.nav-item {
    margin-bottom: 2px;
}

.nav-link {
    display: flex;
    align-items: center;
    padding: 10px 20px;
    /* Biraz daha küçük padding */
    color: var(--sidebar-text);
    text-decoration: none;
    transition: all 0.3s ease;
    border-radius: 0;
    position: relative;
    font-size: 12px;
    /* Menü linklerinin font boyutu */
}

.sidebar.collapsed .nav-link {
    padding: 12px 10px;
    /* Collapsed durumda dengeli padding */
    justify-content: center;
    margin: 2px 10px;
    border-radius: 8px;
    min-height: 40px;
    display: flex;
    align-items: center;
}

.nav-link:hover {
    color: var(--sidebar-text-hover);
    background: var(--sidebar-active-bg);
    transform: translateX(3px);
}

.sidebar.collapsed .nav-link:hover {
    transform: none;
    /* Collapsed durumda kaydırma efekti yok */
}

.nav-link.active {
    color: var(--sidebar-active-text);
    background: var(--sidebar-active-bg);
    font-weight: 500;
}

.nav-link.active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    width: 3px;
    background: var(--sidebar-active-text);
}

.sidebar.collapsed .nav-link.active::before {
    left: 50%;
    top: -2px;
    height: 3px;
    width: 20px;
    transform: translateX(-50%);
}

.nav-icon {
    font-size: 1.1rem;
    /* İkonlar biraz daha küçük */
    width: 18px;
    text-align: center;
    margin-right: 10px;
    /* Icon ile text arasındaki mesafe */
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.sidebar.collapsed .nav-icon {
    margin-right: 0;
    width: 24px;
    height: 24px;
    font-size: 1.2rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.nav-text {
    transition: opacity 0.3s ease;
    white-space: nowrap;
    overflow: hidden;
}

.sidebar.collapsed .nav-text {
    opacity: 0;
    width: 0;
    overflow: hidden;
}

/* Main Content */
.main-content {
    margin-left: var(--sidebar-width);
    margin-top: var(--header-height);
    padding: 20px;
    transition: margin-left 0.3s ease;
    min-height: calc(100vh - var(--header-height));
}

.main-content.collapsed {
    margin-left: var(--sidebar-collapsed-width);
}

/* Header Actions */
.header-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.header-action-btn {
    position: relative;
    background: none;
    border: none;
    color: var(--header-text);
    padding: 8px 12px;
    border-radius: 6px;
    transition: all 0.3s ease;
    font-size: 1.1rem;
    white-space: nowrap;
}

.header-action-btn:hover {
    background: var(--sidebar-active-bg);
    color: var(--sidebar-text-hover);
}

.header-action-btn:focus {
    outline: none;
    box-shadow: 0 0 0 2px var(--sidebar-text-hover);
}

.notification-badge {
    position: absolute;
    top: -2px;
    right: -2px;
    background: #dc3545;
    color: white;
    border-radius: 10px;
    padding: 2px 6px;
    font-size: 0.7rem;
    min-width: 18px;
    text-align: center;
}

/* Dropdown fixes */
.dropdown-menu {
    z-index: 1050 !important;
    border: 1px solid var(--dropdown-border) !important;
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15) !important;
    background-color: var(--dropdown-bg) !important;
    border-radius: 0.5rem;
}

.dropdown-item {
    color: var(--dropdown-text) !important;
    background-color: transparent !important;
}

.dropdown-item:hover,
.dropdown-item:focus {
    background-color: var(--dropdown-hover-bg) !important;
    color: var(--dropdown-hover-text) !important;
}

.dropdown-header {
    color: var(--dropdown-text) !important;
}

.dropdown-divider {
    border-top-color: var(--dropdown-border) !important;
}

.dropdown-toggle::after {
    display: none;
}

/* Tooltip for collapsed sidebar */
.sidebar.collapsed .nav-link {
    position: relative;
}

.sidebar.collapsed .nav-link[data-bs-toggle="tooltip"] {
    pointer-events: auto;
}

/* Smooth scrollbar */
.sidebar-nav::-webkit-scrollbar {
    width: 4px;
}

.sidebar-nav::-webkit-scrollbar-track {
    background: transparent;
}

.sidebar-nav::-webkit-scrollbar-thumb {
    background: var(--sidebar-border);
    border-radius: 2px;
}

.sidebar-nav::-webkit-scrollbar-thumb:hover {
    background: var(--sidebar-text);
}

/* Mobile Overlay */
.mobile-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1035;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

body.mobile-menu-open .mobile-overlay {
    opacity: 1;
    visibility: visible;
}

body.mobile-menu-open {
    overflow: hidden;
}

/* =================
   BASIC STYLES
   ================= */

a {
    text-decoration: none;
}

.wrapper {
    width: 100%;
    position: relative;
}

/* =================
   RESPONSIVE STYLES
   ================= */

/* Responsive */
@media (max-width: 768px) {
    :root {
        --sidebar-width: 0px;
        --sidebar-collapsed-width: 0px;
    }

    .sidebar {
        transform: translateX(-100%);
    }

    .sidebar.mobile-open {
        transform: translateX(0);
        width: 280px;
    }

    .top-header {
        left: 0;
    }

    .main-content {
        margin-left: 0;
        padding: 1rem !important;
    }

    .mobile-menu-btn {
        display: block !important;
    }

    .sidebar-toggle {
        display: none;
    }

    .modal-dialog {
        margin: 0.5rem;
    }

    .card {
        margin-bottom: 1rem;
    }

    .table-responsive {
        font-size: 0.875rem;
    }

    .btn {
        padding: 0.375rem 0.75rem;
        font-size: 0.875rem;
    }

    .btn-sm {
        padding: 0.25rem 0.5rem;
        font-size: 0.8125rem;
    }
}

@media (min-width: 769px) {
    .mobile-menu-btn {
        display: none !important;
    }
}

@media (max-width: 767.98px) {
    .mobile-overlay {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: rgba(0, 0, 0, 0.5);
        z-index: 1035;
        opacity: 0;
        visibility: hidden;
        transition: all 0.3s ease;
    }

    body.mobile-menu-open .mobile-overlay {
        opacity: 1;
        visibility: visible;
    }

    body.mobile-menu-open {
        overflow: hidden;
    }
}

/* Touch-friendly improvements */
@media (pointer: coarse) {
    .btn {
        min-height: 44px;
        min-width: 44px;
    }

    .nav-link {
        min-height: 48px;
        display: flex;
        align-items: center;
    }

    .form-control,
    .form-select {
        min-height: 44px;
    }
}

/* Logo responsive behavior */
.navbar-brand img,
.sidebar img {
    max-height: 46px;
    width: auto;
}

@media (max-width: 576px) {
    .navbar-brand img {
        max-height: 35px;
    }
}

/* Print styles */
@media print {

    .sidebar,
    .top-header,
    .mobile-navbar,
    .offcanvas {
        display: none !important;
    }

    .main-content {
        margin-left: 0 !important;
        margin-top: 0 !important;
    }
}

/* Bakiye badge için özel stil - siyah yazı rengi */
.badge.bg-bakiye {
    background-color: #f8f9fa !important;
    color: #000 !important;
    border: 1px solid #dee2e6;
}

.badge.bg-bakiye-negative {
    background-color: #fff3cd !important;
    color: #000 !important;
    border: 1px solid #ffeeba;
}

/* Extra small button for table actions */
.btn-xs {
    padding: 0.15rem 0.35rem;
    font-size: 0.75rem;
    line-height: 1.2;
}