/* Muhasebe Uygulaması - Modern Tasarım Sistemi */
@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700&display=swap');

:root {
    --primary: #1e40af;
    --primary-dark: #1e3a8a;
    --primary-light: #3b82f6;
    --secondary: #64748b;
    --success: #059669;
    --danger: #dc2626;
    --warning: #d97706;
    --info: #0284c7;
    --bg-body: #f1f5f9;
    --bg-card: #ffffff;
    --text-primary: #0f172a;
    --text-secondary: #64748b;
    --text-muted: #94a3b8;
    --border-color: #e2e8f0;
    --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(15, 23, 42, 0.08), 0 2px 4px -2px rgba(15, 23, 42, 0.05);
    --shadow-lg: 0 10px 15px -3px rgba(15, 23, 42, 0.08), 0 4px 6px -4px rgba(15, 23, 42, 0.05);
    --radius: 0.625rem;
    --navbar-height: 60px;
    --sidebar-width: 260px;
    --topbar-height: 60px;
    --sidebar-bg: #0f172a;
    --sidebar-text: #cbd5e1;
    --sidebar-text-active: #ffffff;
    --sidebar-hover: rgba(255, 255, 255, 0.08);
    --sidebar-active: rgba(59, 130, 246, 0.2);
    --topbar-bg: #ffffff;
    --topbar-border: var(--border-color);
}

[data-theme="dark"] {
    --primary: #3b82f6;
    --primary-dark: #2563eb;
    --primary-light: #60a5fa;
    --secondary: #94a3b8;
    --success: #10b981;
    --danger: #ef4444;
    --warning: #f59e0b;
    --info: #38bdf8;
    --bg-body: #0f172a;
    --bg-card: #1e293b;
    --text-primary: #f1f5f9;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    --border-color: #334155;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.2);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.25);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.3);
    --sidebar-bg: #020617;
    --sidebar-text: #94a3b8;
    --sidebar-text-active: #f8fafc;
    --sidebar-hover: rgba(255, 255, 255, 0.06);
    --sidebar-active: rgba(59, 130, 246, 0.25);
    --topbar-bg: #1e293b;
    --topbar-border: #334155;
}

* {
    box-sizing: border-box;
}

body {
    font-family: 'Plus Jakarta Sans', 'Segoe UI', system-ui, sans-serif;
    background-color: var(--bg-body);
    color: var(--text-primary);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

/* App shell */
.app-body {
    overflow-x: hidden;
}

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

.sidebar-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.5);
    z-index: 1040;
    opacity: 0;
    transition: opacity 0.2s;
}

.sidebar-backdrop.show {
    display: block;
    opacity: 1;
}

/* Sidebar */
.app-sidebar {
    width: var(--sidebar-width);
    min-width: var(--sidebar-width);
    background: var(--sidebar-bg);
    color: var(--sidebar-text);
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    z-index: 1050;
    overflow-y: auto;
    transition: transform 0.25s ease;
}

.sidebar-brand {
    padding: 1rem 1.25rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.sidebar-brand a {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: var(--sidebar-text-active);
    text-decoration: none;
    font-weight: 700;
    font-size: 1.125rem;
}

.sidebar-brand i {
    background: rgba(255, 255, 255, 0.12);
    padding: 0.5rem;
    border-radius: 0.5rem;
}

.sidebar-nav {
    padding: 0.75rem 0.75rem 1.5rem;
}

.sidebar-link {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    padding: 0.5rem 0.75rem;
    color: var(--sidebar-text);
    text-decoration: none;
    border-radius: 0.5rem;
    font-size: 0.875rem;
    font-weight: 500;
    transition: background 0.15s, color 0.15s;
    margin-bottom: 0.125rem;
}

.sidebar-link i {
    width: 1.25rem;
    text-align: center;
    font-size: 0.875rem;
    opacity: 0.85;
}

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

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

.sidebar-section {
    margin-top: 0.25rem;
}

.sidebar-section-toggle {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    width: 100%;
    padding: 0.5rem 0.75rem;
    background: none;
    border: none;
    color: var(--sidebar-text);
    font-size: 0.875rem;
    font-weight: 600;
    border-radius: 0.5rem;
    text-align: left;
    transition: background 0.15s, color 0.15s;
}

.sidebar-section-toggle:hover {
    background: var(--sidebar-hover);
    color: var(--sidebar-text-active);
}

.sidebar-chevron {
    margin-left: auto;
    font-size: 0.7rem;
    transition: transform 0.2s;
}

.sidebar-section-toggle[aria-expanded="true"] .sidebar-chevron {
    transform: rotate(180deg);
}

.sidebar-section .collapse .sidebar-link {
    padding-left: 2.25rem;
    font-size: 0.8125rem;
}

.sidebar-label {
    display: block;
    padding: 0.75rem 0.75rem 0.25rem 2.25rem;
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: rgba(148, 163, 184, 0.7);
}

/* Main content area */
.app-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    min-width: 0;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* Topbar */
.topbar {
    height: var(--topbar-height);
    min-height: var(--topbar-height);
    background: var(--topbar-bg);
    border-bottom: 1px solid var(--topbar-border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 1rem 0 0.75rem;
    position: sticky;
    top: 0;
    z-index: 1030;
    box-shadow: var(--shadow-sm);
}

.topbar-start,
.topbar-end {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.topbar-title {
    min-width: 0;
}

.topbar-page-title {
    font-size: 1.125rem;
    font-weight: 700;
    margin: 0;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.btn-icon {
    width: 2.5rem;
    height: 2.5rem;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--border-color);
    background: var(--bg-card);
    color: var(--text-secondary);
    border-radius: 0.5rem;
    transition: all 0.15s;
}

.btn-icon:hover {
    background: var(--bg-body);
    color: var(--primary);
    border-color: var(--primary-light);
}

.btn-user-menu {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.375rem 0.75rem;
    border: 1px solid var(--border-color);
    background: var(--bg-card);
    color: var(--text-primary);
    border-radius: 0.5rem;
    font-size: 0.875rem;
    font-weight: 500;
}

.btn-user-menu:hover {
    background: var(--bg-body);
}

.lang-switch .btn-lang {
    padding: 0.25rem 0.625rem;
    font-size: 0.75rem;
    font-weight: 700;
    border: 1px solid var(--border-color);
    background: var(--bg-card);
    color: var(--text-secondary);
    text-decoration: none;
}

.lang-switch .btn-lang.active {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
}

/* Notifications */
.notification-btn {
    position: relative;
}

.notification-badge {
    position: absolute;
    top: 0.25rem;
    right: 0.25rem;
    min-width: 1.125rem;
    height: 1.125rem;
    padding: 0 0.25rem;
    background: var(--danger);
    color: #fff;
    font-size: 0.625rem;
    font-weight: 700;
    border-radius: 999px;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

.notification-menu {
    width: 22rem;
    max-width: calc(100vw - 2rem);
    padding: 0;
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-lg);
    border-radius: var(--radius);
    overflow: hidden;
}

.notification-menu-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.875rem 1rem;
    font-weight: 700;
    font-size: 0.875rem;
    border-bottom: 1px solid var(--border-color);
    background: var(--bg-body);
}

.notification-list {
    max-height: 20rem;
    overflow-y: auto;
}

.notification-item {
    display: flex;
    gap: 0.75rem;
    padding: 0.875rem 1rem;
    text-decoration: none;
    color: var(--text-primary);
    border-bottom: 1px solid var(--border-color);
    transition: background 0.15s;
}

.notification-item:last-child {
    border-bottom: none;
}

.notification-item:hover {
    background: var(--bg-body);
}

.notification-icon {
    width: 2rem;
    height: 2rem;
    border-radius: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 0.875rem;
}

.notification-warning .notification-icon {
    background: #fffbeb;
    color: var(--warning);
}

.notification-danger .notification-icon {
    background: #fef2f2;
    color: var(--danger);
}

[data-theme="dark"] .notification-warning .notification-icon {
    background: rgba(245, 158, 11, 0.15);
}

[data-theme="dark"] .notification-danger .notification-icon {
    background: rgba(239, 68, 68, 0.15);
}

.notification-body {
    display: flex;
    flex-direction: column;
    gap: 0.125rem;
    min-width: 0;
}

.notification-body strong {
    font-size: 0.8125rem;
}

.notification-body span {
    font-size: 0.8125rem;
    color: var(--text-secondary);
}

.notification-body small {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.notification-empty {
    padding: 2rem 1rem;
    text-align: center;
    color: var(--text-muted);
}

.notification-empty i {
    font-size: 2rem;
    color: var(--success);
    margin-bottom: 0.5rem;
}

.notification-empty p {
    margin: 0;
    font-size: 0.875rem;
}

/* Toast */
.toast-container {
    z-index: 9999 !important;
}

.toast {
    border-radius: var(--radius) !important;
    box-shadow: var(--shadow-lg) !important;
    font-size: 0.875rem;
    font-weight: 500;
    min-width: 280px;
}

.toast.bg-success {
    background-color: var(--success) !important;
}

.toast.bg-danger {
    background-color: var(--danger) !important;
}

.toast.bg-warning {
    background-color: var(--warning) !important;
}

/* Navbar (legacy) */
.app-navbar {
    background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary) 50%, #2563eb 100%);
    box-shadow: var(--shadow-md);
    min-height: var(--navbar-height);
    padding: 0.5rem 0;
}

.app-navbar .navbar-brand {
    font-weight: 700;
    font-size: 1.25rem;
    letter-spacing: -0.02em;
}

.app-navbar .navbar-brand i {
    background: rgba(255, 255, 255, 0.15);
    padding: 0.4rem;
    border-radius: 0.5rem;
}

.app-navbar .nav-link {
    font-weight: 500;
    font-size: 0.875rem;
    padding: 0.5rem 0.75rem !important;
    border-radius: 0.375rem;
    transition: background 0.2s;
}

.app-navbar .nav-link:hover,
.app-navbar .nav-link:focus {
    background: rgba(255, 255, 255, 0.1);
}

.app-navbar .dropdown-menu {
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-lg);
    border-radius: var(--radius);
    padding: 0.5rem;
    margin-top: 0.25rem;
}

.app-navbar .dropdown-item {
    border-radius: 0.375rem;
    padding: 0.5rem 0.75rem;
    font-size: 0.875rem;
    font-weight: 500;
}

.app-navbar .dropdown-item:hover {
    background: #eff6ff;
    color: var(--primary);
}

.app-navbar .dropdown-header {
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
}

.app-navbar .dropdown-item i {
    width: 1.25rem;
    text-align: center;
    margin-right: 0.5rem;
    color: var(--secondary);
}

/* Main content */
.app-main {
    padding: 1.5rem 0 2rem;
    flex: 1;
    min-height: calc(100vh - var(--topbar-height) - 60px);
}

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

.page-header h1 {
    font-size: 1.75rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    margin: 0;
    color: var(--text-primary);
}

.page-header .breadcrumb {
    margin-bottom: 0.25rem;
    font-size: 0.8125rem;
}

.page-header .breadcrumb-item a {
    color: var(--primary-light);
    text-decoration: none;
}

.page-header .breadcrumb-item.active {
    color: var(--text-muted);
}

/* Cards */
.card {
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    background: var(--bg-card);
    transition: box-shadow 0.2s, transform 0.2s;
}

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

.card-header {
    background: #f8fafc;
    border-bottom: 1px solid var(--border-color);
    font-weight: 600;
    font-size: 0.9375rem;
    padding: 0.875rem 1.25rem;
    border-radius: var(--radius) var(--radius) 0 0 !important;
}

.card-body {
    padding: 1.25rem;
}

/* Stat cards (Dashboard) */
.stat-card {
    border: none;
    border-radius: var(--radius);
    overflow: hidden;
    position: relative;
}

.stat-card::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
}

.stat-card.stat-primary::before { background: var(--primary-light); }
.stat-card.stat-danger::before { background: var(--danger); }
.stat-card.stat-success::before { background: var(--success); }
.stat-card.stat-warning::before { background: var(--warning); }

.stat-card .stat-label {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-bottom: 0.25rem;
}

.stat-card.stat-primary .stat-label { color: var(--primary-light); }
.stat-card.stat-danger .stat-label { color: var(--danger); }
.stat-card.stat-success .stat-label { color: var(--success); }
.stat-card.stat-warning .stat-label { color: var(--warning); }

.stat-card .stat-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: -0.02em;
}

.stat-card .stat-icon {
    width: 3rem;
    height: 3rem;
    border-radius: 0.75rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
}

.stat-card.stat-primary .stat-icon { background: #eff6ff; color: var(--primary-light); }
.stat-card.stat-danger .stat-icon { background: #fef2f2; color: var(--danger); }
.stat-card.stat-success .stat-icon { background: #ecfdf5; color: var(--success); }
.stat-card.stat-warning .stat-icon { background: #fffbeb; color: var(--warning); }

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

.table thead th {
    background: #f8fafc;
    border-bottom: 2px solid var(--border-color);
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-secondary);
    padding: 0.875rem 1rem;
    white-space: nowrap;
}

.table tbody td {
    padding: 0.875rem 1rem;
    vertical-align: middle;
    border-color: var(--border-color);
    font-size: 0.875rem;
}

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

.table-responsive {
    border-radius: 0 0 var(--radius) var(--radius);
}

/* Buttons */
.btn {
    font-weight: 600;
    font-size: 0.875rem;
    border-radius: 0.5rem;
    padding: 0.5rem 1rem;
    transition: all 0.15s;
}

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

.btn-primary:hover {
    background: var(--primary-dark);
    border-color: var(--primary-dark);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(30, 64, 175, 0.3);
}

.btn-sm {
    padding: 0.35rem 0.65rem;
    font-size: 0.8125rem;
}

.btn-group-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    justify-content: center;
}

/* Badges */
.badge {
    font-weight: 600;
    font-size: 0.75rem;
    padding: 0.35em 0.65em;
    border-radius: 0.375rem;
}

/* Forms */
.form-label {
    font-weight: 600;
    font-size: 0.875rem;
    color: var(--text-primary);
    margin-bottom: 0.375rem;
}

.form-control,
.form-select {
    border: 1px solid var(--border-color);
    border-radius: 0.5rem;
    padding: 0.625rem 0.875rem;
    font-size: 0.875rem;
    transition: border-color 0.15s, box-shadow 0.15s;
}

.form-control:focus,
.form-select:focus {
    border-color: var(--primary-light);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}

/* Alerts */
.alert {
    border: none;
    border-radius: var(--radius);
    font-size: 0.875rem;
    font-weight: 500;
    border-left: 4px solid;
}

.alert-success { border-left-color: var(--success); background: #ecfdf5; color: #065f46; }
.alert-danger { border-left-color: var(--danger); background: #fef2f2; color: #991b1b; }
.alert-warning { border-left-color: var(--warning); background: #fffbeb; color: #92400e; }
.alert-info { border-left-color: var(--info); background: #f0f9ff; color: #075985; }

[data-theme="dark"] .card-header {
    background: #0f172a;
}

[data-theme="dark"] .table thead th {
    background: #0f172a;
}

[data-theme="dark"] .table tbody tr:hover {
    background: rgba(255, 255, 255, 0.03);
}

[data-theme="dark"] .alert-success { background: rgba(16, 185, 129, 0.12); color: #6ee7b7; }
[data-theme="dark"] .alert-danger { background: rgba(239, 68, 68, 0.12); color: #fca5a5; }
[data-theme="dark"] .alert-warning { background: rgba(245, 158, 11, 0.12); color: #fcd34d; }
[data-theme="dark"] .alert-info { background: rgba(56, 189, 248, 0.12); color: #7dd3fc; }

[data-theme="dark"] .dropdown-menu {
    background: var(--bg-card);
    border-color: var(--border-color);
}

[data-theme="dark"] .dropdown-item {
    color: var(--text-primary);
}

[data-theme="dark"] .dropdown-item:hover {
    background: var(--bg-body);
    color: var(--primary-light);
}

[data-theme="dark"] .form-control,
[data-theme="dark"] .form-select {
    background: var(--bg-body);
    color: var(--text-primary);
    border-color: var(--border-color);
}

[data-theme="dark"] .btn-close {
    filter: invert(1) grayscale(100%) brightness(200%);
}

/* Filter card */
.filter-card .card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* Footer */
.app-footer {
    background: var(--bg-card);
    border-top: 1px solid var(--border-color);
    padding: 1rem 0;
    font-size: 0.8125rem;
    color: var(--text-muted);
}

/* Login page */
.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #0f172a 0%, #1e3a8a 40%, #2563eb 100%);
    position: relative;
    overflow: hidden;
}

.login-page::before {
    content: '';
    position: absolute;
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, rgba(255,255,255,0.08) 0%, transparent 70%);
    top: -200px;
    right: -200px;
    border-radius: 50%;
}

.login-page::after {
    content: '';
    position: absolute;
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, rgba(255,255,255,0.05) 0%, transparent 70%);
    bottom: -100px;
    left: -100px;
    border-radius: 50%;
}

.login-card {
    width: 100%;
    max-width: 420px;
    border: none;
    border-radius: 1rem;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.35);
    overflow: hidden;
    position: relative;
    z-index: 1;
}

.login-card .login-header {
    background: linear-gradient(135deg, var(--primary-dark), var(--primary));
    color: white;
    text-align: center;
    padding: 2rem 1.5rem 1.5rem;
}

.login-card .login-header .login-logo {
    width: 64px;
    height: 64px;
    background: rgba(255,255,255,0.15);
    border-radius: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1rem;
    font-size: 1.75rem;
}

.login-card .login-header h1 {
    font-size: 1.375rem;
    font-weight: 700;
    margin: 0;
}

.login-card .login-header p {
    margin: 0.25rem 0 0;
    opacity: 0.85;
    font-size: 0.875rem;
}

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

.login-card .btn-login {
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    border: none;
    padding: 0.75rem;
    font-weight: 600;
    font-size: 1rem;
    border-radius: 0.5rem;
}

.login-card .btn-login:hover {
    transform: translateY(-1px);
    box-shadow: 0 8px 20px rgba(30, 64, 175, 0.35);
}

/* Chart cards */
.chart-card .card-header {
    border-bottom: 1px solid var(--border-color);
}

.chart-card .card-header h6 {
    font-weight: 700;
    font-size: 0.9375rem;
    color: var(--text-primary);
    margin: 0;
}

/* Empty state */
.empty-state {
    text-align: center;
    padding: 3rem 1rem;
    color: var(--text-muted);
}

.empty-state i {
    font-size: 3rem;
    margin-bottom: 1rem;
    opacity: 0.4;
}

/* Pagination */
.pagination .page-link {
    border-radius: 0.375rem;
    margin: 0 0.125rem;
    font-weight: 500;
    font-size: 0.875rem;
    color: var(--primary);
}

.pagination .page-item.active .page-link {
    background: var(--primary);
    border-color: var(--primary);
}

/* Detail view tables */
.detail-table th {
    width: 180px;
    font-weight: 600;
    color: var(--text-secondary);
    font-size: 0.875rem;
}

/* Responsive */
@media (max-width: 991.98px) {
    .app-sidebar {
        transform: translateX(-100%);
    }

    .app-sidebar.show {
        transform: translateX(0);
    }

    .app-content {
        margin-left: 0;
    }

    .topbar-page-title {
        font-size: 1rem;
        max-width: 10rem;
    }

    .page-header h1 {
        font-size: 1.375rem;
    }

    .app-navbar .navbar-collapse {
        background: rgba(0, 0, 0, 0.1);
        border-radius: var(--radius);
        padding: 0.5rem;
        margin-top: 0.5rem;
    }
}

@media (max-width: 767.98px) {
    .stat-card .stat-value {
        font-size: 1.25rem;
    }

    table thead th:last-child,
    table tbody td:last-child {
        min-width: 200px;
    }
}
