/* Sidebar */
.sidebar {
    width: 250px;
    background: white;
    box-shadow: 2px 0 10px rgba(0, 0, 0, 0.1);
    display: flex;
    flex-direction: column;
    transition: all 0.3s ease;
    position: fixed;
    height: 100vh;
    z-index: 1000;
}


/* Layout fix: sidebar fixed olduğu için main içerik sola kaymasın */
.main-content{
    margin-left: 250px; /* sidebar width ile aynı */
    width: calc(100% - 250px);
    min-height: 100vh;
}


.sidebar-header {
    padding: 25px 20px;
    border-bottom: 1px solid var(--light-gray);
}

.sidebar-header h3 {
    color: var(--primary);
    font-size: 20px;
}

.sidebar-nav {
    flex: 1;
    padding: 20px 0;
}

.nav-item {
    padding: 12px 20px;
    display: flex;
    align-items: center;
    gap: 12px;
    color: var(--gray);
    text-decoration: none;
    transition: all 0.3s ease;
    border-left: 3px solid transparent;
}

.nav-item:hover {
    background: rgba(67, 97, 238, 0.1);
    color: var(--primary);
    border-left-color: var(--primary);
}

.nav-item.active {
    background: rgba(67, 97, 238, 0.1);
    color: var(--primary);
    border-left-color: var(--primary);
    font-weight: 500;
}

.nav-item i {
    width: 20px;
    text-align: center;
}

/* Navbar */
.navbar {
    background: white;
    padding: 15px 25px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    position: sticky;
    top: 0;
    z-index: 100;
}

.navbar-left h1 {
    font-size: 24px;
    color: var(--dark);
    font-weight: 600;
}

.navbar-right {
    display: flex;
    align-items: center;
    gap: 20px;
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
}

.user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--primary);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 2000;
    align-items: center;
    justify-content: center;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: white;
    border-radius: var(--border-radius);
    padding: 30px;
    max-width: 500px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid var(--light-gray);
}

.modal-close {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: var(--gray);
}

/* Tabs */
.tabs {
    display: flex;
    border-bottom: 2px solid var(--light-gray);
    margin-bottom: 20px;
}

.tab {
    padding: 12px 24px;
    background: none;
    border: none;
    cursor: pointer;
    font-weight: 500;
    color: var(--gray);
    border-bottom: 2px solid transparent;
    transition: all 0.3s ease;
}

.tab.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
}

/* Forms */
.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin-bottom: 15px;
}

.form-control {
    margin-bottom: 15px;
}

.form-control label {
    display: block;
    margin-bottom: 5px;
    color: var(--gray);
    font-weight: 500;
}

.form-control input,
.form-control select,
.form-control textarea {
    width: 100%;
    padding: 10px 12px;
    border: 2px solid var(--light-gray);
    border-radius: 6px;
    font-size: 14px;
    transition: all 0.3s ease;
}

.form-control input:focus,
.form-control select:focus,
.form-control textarea:focus {
    border-color: var(--primary);
    outline: none;
}

/* Badges */
.badge {
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
}

.badge-success {
    background: rgba(46, 204, 113, 0.2);
    color: var(--success);
}

.badge-warning {
    background: rgba(243, 156, 18, 0.2);
    color: var(--warning);
}

.badge-danger {
    background: rgba(231, 76, 60, 0.2);
    color: var(--danger);
}

.badge-info {
    background: rgba(52, 152, 219, 0.2);
    color: var(--info);
}

/* Charts */
.chart-container {
    position: relative;
    height: 300px;
    margin: 20px 0;
}


/* Mobil bottom nav */
.bottom-nav{
  display:none;
}

@media (max-width: 992px){
  .bottom-nav{
    display:flex;
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    height: 64px;
    background: #fff;
    box-shadow: 0 -2px 10px rgba(0,0,0,.08);
    z-index: 1200;
    align-items:center;
    justify-content: space-around;
    padding: 0 10px;
  }

  .bottom-nav a{
    flex:1;
    text-decoration:none;
    color: var(--gray);
    display:flex;
    flex-direction:column;
    align-items:center;
    justify-content:center;
    gap: 4px;
    font-size: 11px;
    padding: 8px 0;
  }

  .bottom-nav a.active{
    color: var(--primary);
    font-weight: 600;
  }

  .content-area{
    padding-bottom: 80px; /* bottom nav için boşluk */
  }

  /* Mobilde sidebar’ı tamamen gizle (istersen “More” ile açtırırız) */
  .sidebar{ display:none; }
  .main-content{ margin-left:0; width:100%; }
}



#toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 10px;
    pointer-events: none; /* Arka planın tıklanabilir kalmasını sağlar */
}

.toast {
    position: relative;
    width: 320px;
    background: #fff;
    border-radius: 8px;
    padding: 16px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    display: flex;
    align-items: center;
    gap: 12px;
    pointer-events: auto;
    overflow: hidden;
    transform: translateX(100%); /* Başlangıç konumu */
    transition: transform 0.3s cubic-bezier(0.18, 0.89, 0.32, 1.28), opacity 0.3s;
    opacity: 0;
}

/* Giriş Animasyonu */
.toast.show {
    transform: translateX(0);
    opacity: 1;
}

/* Çıkış Animasyonu (JS remove fonksiyonu burayı tetikler) */
.toast.hiding {
    animation: slideOut 0.3s forwards ease-in;
}

@keyframes slideOut {
    to {
        transform: translateX(100%);
        opacity: 0;
        max-height: 0;
        margin: 0;
        padding: 0;
    }
}

/* İkon ve İçerik */
.toast-icon { font-size: 1.2rem; }
.toast-success .toast-icon { color: #2ecc71; }
.toast-error .toast-icon { color: #e74c3c; }
.toast-warning .toast-icon { color: #f1c40f; }
.toast-info .toast-icon { color: #3498db; }

.toast-content { flex: 1; }
.toast-title { font-weight: bold; font-size: 0.9rem; margin-bottom: 2px; }
.toast-message { font-size: 0.85rem; color: #555; }

.toast-close {
    background: none; border: none; cursor: pointer; color: #aaa; padding: 0 4px;
}
.toast-close:hover { color: #333; }

/* Progress Bar */
.toast-progress {
    position: absolute;
    bottom: 0;
    left: 0;
    height: 3px;
    background: rgba(0,0,0,0.1);
    width: 100%;
    /* CSS değişkeni JS'den geliyor */
    animation: progress linear forwards;
    animation-duration: var(--duration, 3200ms);
    transform-origin: left;
}

@keyframes progress {
    to { transform: scaleX(0); }
}

.table td, .table th { white-space: nowrap; }
.table-container { overflow-x: auto; }


.table-container { overflow-x: auto; }
.table th, .table td { white-space: nowrap; }
