/**
 * KSK Rönesans ERP - Ana Stil Dosyası
 * @author Mustafa DEVEBAKAN
 */

:root {
    --primary-color: #2563eb;
    --primary-hover: #1d4ed8;
    --primary-light: #dbeafe;
    --secondary-color: #64748b;
    --success-color: #22c55e;
    --warning-color: #f59e0b;
    --danger-color: #ef4444;
    --info-color: #06b6d4;
    --dark-color: #1e293b;
    --light-color: #f8fafc;
    --sidebar-width: 260px;
    --sidebar-collapsed-width: 70px;
    --header-height: 64px;
    --border-radius: 8px;
    --box-shadow: 0 1px 3px rgba(0,0,0,0.1), 0 1px 2px rgba(0,0,0,0.06);
    --box-shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.1), 0 4px 6px -2px rgba(0,0,0,0.05);
    --transition: all 0.3s ease;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    font-size: 14px;
    color: #334155;
    background-color: #f1f5f9;
    line-height: 1.5;
}

a {
    color: var(--primary-color);
    text-decoration: none;
    transition: var(--transition);
}

a:hover {
    color: var(--primary-hover);
}

/* Wrapper */
.wrapper {
    display: flex;
    min-height: 100vh;
}

/* ==================== SIDEBAR ==================== */
.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: var(--sidebar-width);
    height: 100vh;
    background: linear-gradient(180deg, #1e293b 0%, #0f172a 100%);
    z-index: 1040;
    display: flex;
    flex-direction: column;
    transition: var(--transition);
    overflow: hidden;
}

.sidebar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.sidebar-logo {
    display: flex;
    align-items: center;
    gap: 12px;
    color: #fff;
    font-weight: 600;
    font-size: 18px;
}

.sidebar-logo svg {
    color: var(--primary-color);
}

.sidebar-logo:hover {
    color: #fff;
}

.sidebar-close {
    display: none;
    background: none;
    border: none;
    color: #94a3b8;
    font-size: 20px;
    cursor: pointer;
}

.sidebar-nav {
    flex: 1;
    overflow-y: auto;
    padding: 16px 0;
}

.sidebar-nav::-webkit-scrollbar {
    width: 4px;
}

.sidebar-nav::-webkit-scrollbar-track {
    background: transparent;
}

.sidebar-nav::-webkit-scrollbar-thumb {
    background: rgba(255,255,255,0.2);
    border-radius: 4px;
}

.sidebar-menu {
    list-style: none;
    padding: 0 12px;
}

.sidebar-item {
    margin-bottom: 4px;
}

.sidebar-link {
    display: flex;
    align-items: center;
    padding: 10px 12px;
    color: #94a3b8;
    border-radius: 6px;
    transition: var(--transition);
    cursor: pointer;
}

.sidebar-link:hover,
.sidebar-link.active {
    background: rgba(255,255,255,0.1);
    color: #fff;
}

.sidebar-link.active {
    background: var(--primary-color);
}

.sidebar-icon {
    width: 20px;
    height: 20px;
    margin-right: 12px;
    flex-shrink: 0;
}

.sidebar-arrow {
    width: 16px;
    height: 16px;
    margin-left: auto;
    transition: var(--transition);
}

.sidebar-item.open > .sidebar-link .sidebar-arrow {
    transform: rotate(90deg);
}

.sidebar-submenu {
    display: none;
    list-style: none;
    padding: 8px 0 8px 44px;
}

.sidebar-item.open > .sidebar-submenu {
    display: block;
}

.sidebar-submenu li {
    margin-bottom: 2px;
}

.sidebar-submenu a {
    display: flex;
    align-items: center;
    padding: 8px 12px;
    color: #94a3b8;
    font-size: 13px;
    border-radius: 4px;
    transition: var(--transition);
}

.sidebar-submenu a:hover,
.sidebar-submenu a.active {
    color: #fff;
    background: rgba(255,255,255,0.05);
}

.submenu-dot {
    width: 6px;
    height: 6px;
    background: currentColor;
    border-radius: 50%;
    margin-right: 10px;
    opacity: 0.5;
}

.sidebar-submenu a:hover .submenu-dot,
.sidebar-submenu a.active .submenu-dot {
    opacity: 1;
    background: var(--primary-color);
}

.sidebar-footer {
    padding: 12px 20px;
    border-top: 1px solid rgba(255,255,255,0.1);
    text-align: center;
}

.sidebar-version {
    color: #64748b;
}

.sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 1030;
}

/* ==================== MAIN CONTENT ==================== */
.main-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    min-height: 100vh;
    transition: var(--transition);
}

.navbar {
    height: var(--header-height);
    padding: 0 24px;
    box-shadow: var(--box-shadow);
}

.sidebar-toggle {
    padding: 8px;
    border-radius: 6px;
}

.sidebar-toggle:hover {
    background: #f1f5f9;
}

.page-content {
    padding: 24px;
}

/* ==================== CARDS ==================== */
.card {
    background: #fff;
    border: none;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    margin-bottom: 24px;
}

.card-header {
    background: transparent;
    border-bottom: 1px solid #e2e8f0;
    padding: 16px 20px;
    font-weight: 600;
}

.card-body {
    padding: 20px;
}

.card-footer {
    background: transparent;
    border-top: 1px solid #e2e8f0;
    padding: 16px 20px;
}

/* ==================== STAT CARDS ==================== */
.stat-card {
    display: flex;
    align-items: center;
    padding: 20px;
    background: #fff;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
}

.stat-icon {
    width: 56px;
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    font-size: 24px;
    margin-right: 16px;
}

.stat-icon.primary { background: var(--primary-light); color: var(--primary-color); }
.stat-icon.success { background: #dcfce7; color: var(--success-color); }
.stat-icon.warning { background: #fef3c7; color: var(--warning-color); }
.stat-icon.danger { background: #fee2e2; color: var(--danger-color); }
.stat-icon.info { background: #cffafe; color: var(--info-color); }

.stat-content {
    flex: 1;
}

.stat-value {
    font-size: 24px;
    font-weight: 700;
    color: var(--dark-color);
    line-height: 1.2;
}

.stat-label {
    font-size: 13px;
    color: #64748b;
    margin-top: 4px;
}

.stat-change {
    font-size: 12px;
    display: flex;
    align-items: center;
    gap: 4px;
    margin-top: 4px;
}

.stat-change.up { color: var(--success-color); }
.stat-change.down { color: var(--danger-color); }

/* ==================== TABLES ==================== */
.table {
    margin-bottom: 0;
}

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

.table tbody td {
    padding: 12px 16px;
    vertical-align: middle;
    border-color: #f1f5f9;
}

.table tbody tr:hover {
    background: #f8fafc;
}

.table-actions {
    white-space: nowrap;
}

.table-actions .btn {
    padding: 4px 8px;
    font-size: 13px;
}

/* ==================== FORMS ==================== */
.form-label {
    font-weight: 500;
    color: #475569;
    margin-bottom: 6px;
}

.form-control,
.form-select {
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    padding: 10px 12px;
    font-size: 14px;
    transition: var(--transition);
}

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

.form-control::placeholder {
    color: #94a3b8;
}

.input-group-text {
    background: #f8fafc;
    border-color: #e2e8f0;
}

.form-check-input:checked {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

/* ==================== BUTTONS ==================== */
.btn {
    font-weight: 500;
    padding: 10px 16px;
    border-radius: 6px;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.btn-primary {
    background: var(--primary-color);
    border-color: var(--primary-color);
}

.btn-primary:hover {
    background: var(--primary-hover);
    border-color: var(--primary-hover);
}

.btn-outline-primary {
    color: var(--primary-color);
    border-color: var(--primary-color);
}

.btn-outline-primary:hover {
    background: var(--primary-color);
    border-color: var(--primary-color);
}

.btn-light {
    background: #f1f5f9;
    border-color: #f1f5f9;
    color: #475569;
}

.btn-light:hover {
    background: #e2e8f0;
    border-color: #e2e8f0;
    color: #334155;
}

.btn-sm {
    padding: 6px 12px;
    font-size: 13px;
}

.btn-lg {
    padding: 12px 24px;
    font-size: 16px;
}

/* ==================== BADGES ==================== */
.badge {
    font-weight: 500;
    padding: 5px 10px;
    font-size: 12px;
    border-radius: 4px;
}

/* ==================== NOTIFICATIONS ==================== */
.notification-dropdown {
    width: 360px;
    padding: 0;
    border: none;
    box-shadow: var(--box-shadow-lg);
}

.dropdown-header {
    padding: 16px;
    background: #f8fafc;
    border-bottom: 1px solid #e2e8f0;
}

.notification-list {
    max-height: 320px;
    overflow-y: auto;
}

.notification-item {
    display: flex;
    padding: 12px 16px;
    border-bottom: 1px solid #f1f5f9;
    transition: var(--transition);
}

.notification-item:hover {
    background: #f8fafc;
}

.notification-item.unread {
    background: #eff6ff;
}

.notification-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 12px;
    flex-shrink: 0;
}

.notification-icon.bilgi { background: #dbeafe; color: var(--primary-color); }
.notification-icon.uyari { background: #fef3c7; color: var(--warning-color); }
.notification-icon.hata { background: #fee2e2; color: var(--danger-color); }
.notification-icon.basari { background: #dcfce7; color: var(--success-color); }

.notification-content {
    flex: 1;
    min-width: 0;
}

.notification-title {
    font-weight: 500;
    color: #1e293b;
    margin-bottom: 2px;
}

.notification-text {
    font-size: 13px;
    color: #64748b;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.notification-time {
    font-size: 12px;
    color: #94a3b8;
    margin-top: 4px;
}

.dropdown-footer {
    padding: 12px 16px;
    border-top: 1px solid #e2e8f0;
    background: #f8fafc;
}

/* ==================== PAGE HEADER ==================== */
.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
    flex-wrap: wrap;
    gap: 16px;
}

.page-title {
    font-size: 24px;
    font-weight: 600;
    color: var(--dark-color);
    margin: 0;
}

.breadcrumb {
    margin: 0;
    background: transparent;
    padding: 0;
}

.breadcrumb-item {
    font-size: 13px;
}

.breadcrumb-item a {
    color: #64748b;
}

.breadcrumb-item.active {
    color: #1e293b;
}

/* ==================== AVATAR ==================== */
.avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 500;
    color: #fff;
    flex-shrink: 0;
}

.avatar-sm { width: 32px; height: 32px; font-size: 12px; }
.avatar-lg { width: 56px; height: 56px; font-size: 20px; }
.avatar-xl { width: 80px; height: 80px; font-size: 28px; }

/* ==================== CHARTS ==================== */
.chart-container {
    position: relative;
    height: 300px;
}

/* ==================== LOADING ==================== */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255,255,255,0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid #e2e8f0;
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* ==================== LOGIN PAGE ==================== */
.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
    padding: 20px;
}

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

.login-logo {
    text-align: center;
    margin-bottom: 32px;
}

.login-logo svg {
    width: 64px;
    height: 64px;
    color: var(--primary-color);
}

.login-logo h1 {
    font-size: 24px;
    font-weight: 700;
    color: var(--dark-color);
    margin-top: 16px;
}

.login-logo p {
    color: #64748b;
    margin-top: 4px;
}

.login-form .form-control {
    height: 48px;
}

.login-form .btn {
    height: 48px;
}

/* ==================== RESPONSIVE ==================== */
@media (max-width: 991.98px) {
    .sidebar {
        transform: translateX(-100%);
    }
    
    .sidebar.show {
        transform: translateX(0);
    }
    
    .sidebar-close {
        display: block;
    }
    
    .sidebar-overlay.show {
        display: block;
    }
    
    .main-content {
        margin-left: 0;
    }
}

@media (max-width: 767.98px) {
    .page-content {
        padding: 16px;
    }
    
    .page-header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .notification-dropdown {
        width: 300px;
    }
    
    .stat-card {
        padding: 16px;
    }
    
    .stat-icon {
        width: 48px;
        height: 48px;
        font-size: 20px;
    }
    
    .stat-value {
        font-size: 20px;
    }
}

/* ==================== SIDEBAR COLLAPSED ==================== */
.sidebar-collapsed .sidebar {
    width: var(--sidebar-collapsed-width);
}

.sidebar-collapsed .sidebar-logo-text,
.sidebar-collapsed .sidebar-link span,
.sidebar-collapsed .sidebar-arrow,
.sidebar-collapsed .sidebar-submenu,
.sidebar-collapsed .sidebar-version {
    display: none;
}

.sidebar-collapsed .sidebar-link {
    justify-content: center;
    padding: 12px;
}

.sidebar-collapsed .sidebar-icon {
    margin-right: 0;
}

.sidebar-collapsed .main-content {
    margin-left: var(--sidebar-collapsed-width);
}

/* ==================== PRINT ==================== */
@media print {
    .sidebar,
    .navbar,
    .btn,
    .no-print {
        display: none !important;
    }
    
    .main-content {
        margin-left: 0 !important;
    }
    
    .page-content {
        padding: 0 !important;
    }
    
    .card {
        box-shadow: none !important;
        border: 1px solid #ddd !important;
    }
}
