/* ============================================================
 * MAIN STYLES - Layout & Components
 * ============================================================ */

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

body {
    font-family: 'Segoe UI', -apple-system, BlinkMacSystemFont, 'Roboto', 'Helvetica Neue', Arial, sans-serif;
    font-size: 13px;
    background: var(--bg);
    color: var(--text);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ============================================================
 * LAYOUT
 * ============================================================ */

#app {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    min-width: 0;
    overflow-x: hidden;
}

/* — Header (logo + yatay menü + kullanıcı araçları) — */
.app-header,
header.app-header {
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    padding: 0 12px;
    display: flex;
    align-items: stretch;
    flex-wrap: nowrap;
    gap: 8px;
    min-height: 48px;
    position: sticky;
    top: 0;
    z-index: 100;
    min-width: 0;
    overflow: visible;
}

.header-start {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.header-brand {
    font-size: 15px;
    font-weight: 700;
    color: var(--accent);
    text-decoration: none;
    white-space: nowrap;
    line-height: 1.2;
    padding: 4px 0;
}

.header-brand:hover {
    color: var(--accent);
    opacity: 0.9;
}

/* ── Uygulama logosu ── */
.app-logo {
    display: inline-flex;
    align-items: center;
    text-decoration: none;
    line-height: 0;
}

.app-logo-img {
    display: block;
    width: auto;
    object-fit: contain;
}

.app-logo--header .app-logo-img {
    height: 32px;
    max-width: 140px;
}

.app-logo--auth {
    justify-content: center;
}

.app-logo--auth .app-logo-img {
    height: 56px;
    max-width: 220px;
}

/* ── Auth sayfaları (giriş, şifre sıfırlama) ── */
.auth-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 20px;
}

.auth-container {
    width: 100%;
    max-width: 420px;
}

.auth-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 32px;
    box-shadow: var(--shadow-lg);
}

.auth-brand {
    display: flex;
    justify-content: center;
    margin-bottom: 20px;
}

.auth-heading {
    text-align: center;
    color: var(--accent);
    font-size: 20px;
    font-weight: 700;
    margin: 0 0 8px;
}

.auth-subtitle {
    text-align: center;
    color: var(--muted);
    font-size: 13px;
    line-height: 1.5;
    margin: 0 0 24px;
}

.auth-card .form-group {
    margin-bottom: 16px;
}

.auth-card button[type="submit"] {
    width: 100%;
    padding: 12px;
    font-size: 14px;
    font-weight: 600;
    margin-top: 8px;
}

.auth-card .auth-link,
.auth-card a.auth-link {
    display: block;
    text-align: center;
    color: var(--accent);
    text-decoration: none;
    font-size: 13px;
    margin-top: 16px;
}

.auth-card .auth-link:hover,
.auth-card a.auth-link:hover {
    text-decoration: underline;
}

.auth-remember-row {
    margin-bottom: 8px;
}

.auth-remember {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: var(--muted);
    cursor: pointer;
    user-select: none;
}

.auth-remember input {
    width: 16px;
    height: 16px;
    accent-color: var(--accent);
    cursor: pointer;
}

.header-profile-link {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 5px 12px 5px 8px;
    border-radius: 999px;
    text-decoration: none;
    color: var(--text);
    font-size: 12px;
    font-weight: 600;
    flex-shrink: 0;
    max-width: 190px;
    border: 1px solid var(--border);
    background: var(--surface2);
    transition: color 0.2s ease, background 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.header-profile-link svg {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
    color: var(--accent);
}

.header-profile-link span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    min-width: 0;
}

.header-profile-link:hover {
    color: var(--accent);
    border-color: color-mix(in srgb, var(--accent) 40%, var(--border));
    background: color-mix(in srgb, var(--accent) 8%, var(--surface2));
    box-shadow: var(--shadow-sm);
}

.header-profile-link.active {
    color: var(--accent);
    border-color: color-mix(in srgb, var(--accent) 45%, var(--border));
    background: color-mix(in srgb, var(--accent) 12%, var(--surface2));
}

.app-header-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: nowrap;
    flex-shrink: 0;
    margin-left: auto;
    padding: 6px 0;
}

.header-firma-wrap {
    flex: 0 1 200px;
    min-width: 88px;
    max-width: 220px;
}

.header-firma-select,
#firma-secici.header-firma-select {
    width: 100%;
    max-width: 100%;
    padding: 4px 8px;
    font-size: 12px;
    line-height: 1.3;
    min-height: 32px;
    text-overflow: ellipsis;
}

.app-header-actions .theme-switcher {
    flex-shrink: 0;
}

.app-header-actions form {
    flex-shrink: 0;
    margin: 0;
}

/* — Yatay navigasyon (header içi) — */
.app-nav,
nav.app-nav {
    flex: 1 1 auto;
    min-width: 0;
    display: flex;
    align-items: stretch;
    overflow: visible;
    background: transparent;
    border: none;
    position: relative;
}

.app-nav-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-wrap: nowrap;
    align-items: stretch;
    gap: 2px;
    min-width: 0;
    overflow: visible;
}

.app-nav-list > li {
    margin: 0;
    flex-shrink: 0;
    display: flex;
    align-items: stretch;
}

.app-nav a {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 0 12px;
    min-height: 48px;
    color: var(--muted);
    text-decoration: none;
    font-size: 12px;
    border-bottom: 2px solid transparent;
    border-left: none;
    white-space: nowrap;
    transition: color 0.15s ease, background 0.15s ease, border-color 0.15s ease;
}

.app-nav a:hover {
    background: var(--surface2);
    color: var(--text);
}

.app-nav li.active > a,
.app-nav a.active {
    background: var(--surface2);
    color: var(--accent);
    border-bottom-color: var(--accent);
    border-left: none;
    font-weight: 600;
}

.app-nav li.nav-dropdown {
    position: relative;
}

.app-nav li.nav-dropdown.open {
    z-index: 160;
}

.app-nav .nav-dropdown-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 6px;
    width: 100%;
    min-height: 48px;
    padding: 0 12px;
    border: none;
    border-bottom: 2px solid transparent;
    background: transparent;
    color: var(--muted);
    font-size: 12px;
    font-family: inherit;
    text-align: left;
    cursor: pointer;
    white-space: nowrap;
    transition: color 0.15s ease, background 0.15s ease, border-color 0.15s ease;
}

.app-nav .nav-dropdown-toggle:hover {
    background: var(--surface2);
    color: var(--text);
}

.app-nav li.nav-dropdown.active > .nav-dropdown-toggle,
.app-nav li.nav-dropdown.open > .nav-dropdown-toggle {
    color: var(--accent);
    font-weight: 600;
}

.app-nav li.nav-dropdown.active > .nav-dropdown-toggle {
    border-bottom-color: var(--accent);
    background: var(--surface2);
}

.app-nav .nav-dropdown-arrow {
    font-size: 9px;
    opacity: 0.7;
    transition: transform 0.2s ease;
}

.app-nav li.nav-dropdown.open .nav-dropdown-arrow {
    transform: rotate(180deg);
}

.app-nav .nav-dropdown-menu {
    list-style: none;
    margin: 0;
    padding: 4px 0;
    display: none;
    position: absolute;
    top: calc(100% + 1px);
    left: 0;
    min-width: 200px;
    max-width: min(280px, 90vw);
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    z-index: 150;
}

.app-nav li.nav-dropdown.open .nav-dropdown-menu {
    display: block;
}

.app-nav .nav-dropdown-menu a {
    min-height: 36px;
    padding: 8px 14px;
    font-size: 12px;
    border-bottom: none;
}

.app-nav .nav-dropdown-menu li.active > a {
    color: var(--accent);
    background: var(--surface2);
    font-weight: 600;
}

/* Eski nav seçicileri (uyumluluk) */
nav a {
    display: flex;
    align-items: center;
    color: var(--muted);
    text-decoration: none;
}

/* Main Content — tam genişlik */
main {
    flex: 1;
    width: 100%;
    max-width: none;
    padding: 16px 20px;
    overflow-x: hidden;
    min-width: 0;
}

main h2 {
    font-size: 18px;
    font-weight: 700;
    color: var(--accent);
    margin-bottom: 16px;
}

/* ============================================================
 * COMPONENTS
 * ============================================================ */

/* Cards */
.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    margin-bottom: 16px;
    overflow: hidden;
}

.card-header {
    padding: 12px 16px;
    background: var(--surface2);
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
}

.card-header span {
    font-weight: 600;
    font-size: 13px;
    color: var(--text);
}

.card-body {
    padding: 16px;
}

/* Alerts */
#app-alert {
    position: fixed;
    top: 16px;
    right: 16px;
    z-index: 9999;
    max-width: 380px;
    pointer-events: none;
}

.alert {
    padding: 12px 16px;
    border-radius: var(--radius);
    margin-bottom: 8px;
    font-size: 12px;
    font-weight: 500;
    box-shadow: var(--shadow-md);
    pointer-events: all;
    animation: slideIn 0.3s ease;
}

@keyframes slideIn {
    from {
        transform: translateX(400px);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.alert.success {
    background: var(--green);
    color: #fff;
}

.alert.error {
    background: var(--red);
    color: #fff;
}

.alert.info {
    background: var(--accent);
    color: #fff;
}

.alert.warning {
    background: var(--yellow);
    color: #000;
}

/* Buttons — default = nötr; variant sınıfları / submit ayrı hover */
button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 8px 16px;
    border-radius: var(--radius);
    border: 1px solid var(--btn-default-border);
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    font-family: inherit;
    transition:
        background-color 0.18s ease,
        color 0.18s ease,
        border-color 0.18s ease,
        box-shadow 0.18s ease,
        transform 0.15s ease;
    background: var(--btn-default-bg);
    color: var(--btn-default-text);
}

button:focus-visible {
    outline: none;
    box-shadow:
        var(--shadow-sm),
        0 0 0 3px var(--focus-ring);
}

button:hover:not(:disabled) {
    background: var(--btn-default-hover-bg);
    border-color: var(--btn-default-hover-border);
    box-shadow: var(--shadow-sm);
}

button:active:not(:disabled) {
    transform: translateY(1px);
    box-shadow: none;
}

button:disabled {
    opacity: 0.48;
    cursor: not-allowed;
}

button[type="submit"],
button.btn-primary {
    border-color: transparent;
    background: var(--btn-primary-bg);
    color: var(--btn-primary-text);
}

button[type="submit"]:hover:not(:disabled),
button.btn-primary:hover:not(:disabled) {
    background: var(--btn-primary-hover-bg);
    border-color: transparent;
    box-shadow: var(--shadow-md);
}

button.btn-success {
    border-color: transparent;
    background: var(--btn-success-bg);
    color: var(--btn-success-text);
}

button.btn-success:hover:not(:disabled) {
    background: var(--btn-success-hover-bg);
    border-color: transparent;
    box-shadow: var(--shadow-md);
}

button.btn-danger {
    border-color: transparent;
    background: var(--btn-danger-bg);
    color: var(--btn-danger-text);
}

button.btn-danger:hover:not(:disabled) {
    background: var(--btn-danger-hover-bg);
    border-color: transparent;
    box-shadow: var(--shadow-md);
}

button.btn-warning {
    border-color: transparent;
    background: var(--btn-warning-bg);
    color: var(--btn-warning-text);
}

button.btn-warning:hover:not(:disabled) {
    background: var(--btn-warning-hover-bg);
    border-color: transparent;
    box-shadow: var(--shadow-md);
}

button.btn-secondary {
    border: 1px solid var(--btn-secondary-border);
    background: var(--btn-secondary-bg);
    color: var(--btn-secondary-text);
}

button.btn-secondary:hover:not(:disabled) {
    background: var(--btn-secondary-hover-bg);
    border-color: var(--btn-secondary-border);
    box-shadow: var(--shadow-sm);
}

/* Dokunmuş modal / sekme düğmeleri — nötr toolbar hover'a karışmasın */
.firma-modal-tabs button:hover:not(:disabled) {
    background: none !important;
    border-color: transparent !important;
    box-shadow: none !important;
    transform: none;
    color: var(--text);
}

header .mobile-menu-toggle:hover:not(:disabled) {
    background: transparent;
    border-color: transparent;
    box-shadow: none;
    transform: none;
    color: var(--accent);
}

/* Genel button {} nav/mobil kapat üstünde kaldığı için burada netleştir */
button.nav-close-btn {
    display: none;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    padding: 0;
    border: none;
    border-radius: var(--radius);
    background: transparent;
    color: var(--muted);
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
    flex-shrink: 0;
    font-weight: 400;
    transition: color 0.15s ease, background 0.15s ease;
}

button.nav-close-btn:hover:not(:disabled) {
    color: var(--text);
    background: var(--surface2);
    border: none;
    box-shadow: none;
    transform: none;
}

/* Forms */
label {
    display: block;
    margin-bottom: 6px;
    color: var(--muted);
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
input[type="date"],
input[type="tel"],
input[type="search"],
select,
textarea {
    width: 100%;
    padding: 10px 12px;
    border-radius: var(--radius);
    border: 1px solid var(--input-border);
    background: var(--input-bg);
    color: var(--text);
    font-size: 13px;
    font-family: inherit;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

input::placeholder,
textarea::placeholder {
    color: var(--input-placeholder);
    opacity: 1;
}

input:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--focus-ring);
}

input[readonly],
input[disabled] {
    opacity: 0.6;
    cursor: not-allowed;
}

select {
    cursor: pointer;
}

/* Tables */
table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12px;
    background: var(--surface);
}

thead {
    position: sticky;
    top: 0;
    z-index: 2;
    background: var(--surface2);
}

th {
    padding: 10px 12px;
    text-align: left;
    color: var(--accent);
    font-weight: 600;
    white-space: nowrap;
    border-bottom: 2px solid var(--border);
}

td {
    padding: 10px 12px;
    border-bottom: 1px solid var(--border);
    max-width: 300px;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Panel tabloları: hafif ızgara (modallar hariç #app içi main + card) */
#app main table:not(.table-no-grid) th,
#app main table:not(.table-no-grid) td {
    border-left: 1px solid var(--table-grid);
    border-top: 1px solid var(--table-grid);
}

#app main table:not(.table-no-grid) {
    border-right: 1px solid var(--table-grid);
    border-bottom: 1px solid var(--table-grid);
}

#app main table:not(.table-no-grid) thead th {
    border-bottom-color: var(--border);
    border-bottom-width: 2px;
}

#app main table:not(.table-no-grid) tbody td {
    border-bottom: 1px solid var(--table-grid);
}

/* Kolonlar gizlenince yer kaplamasın */
#app table th.data-table-col-hidden,
#app table td.data-table-col-hidden {
    display: none !important;
}

tr:hover td {
    background: var(--surface2);
}

/* Modals */
.modal {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.modal.show {
    display: flex;
}

.modal-content {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 10px;
    max-width: 600px;
    width: 100%;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    box-shadow: var(--shadow-lg);
    animation: modalIn 0.3s ease;
}

@keyframes modalIn {
    from {
        transform: scale(0.9);
        opacity: 0;
    }
    to {
        transform: scale(1);
        opacity: 1;
    }
}

.modal-header {
    padding: 16px 20px;
    background: var(--surface2);
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-radius: 10px 10px 0 0;
}

.modal-header strong {
    color: var(--text);
    font-size: 14px;
}

.modal-close {
    background: none;
    border: none;
    color: var(--muted);
    font-size: 24px;
    cursor: pointer;
    padding: 0;
    line-height: 1;
}

.modal-close:hover:not(:disabled) {
    color: var(--red);
    background: none !important;
    border-color: transparent !important;
    box-shadow: none !important;
    transform: none;
}

.modal-body {
    padding: 20px;
    overflow-y: auto;
    flex: 1;
}

.modal-footer {
    padding: 12px 20px;
    border-top: 1px solid var(--border);
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    background: var(--surface2);
    border-radius: 0 0 10px 10px;
}

.modal-content.modal-content--wide {
    max-width: 720px;
}

.firma-modal-tabs {
    display: flex;
    gap: 8px;
    border-bottom: 2px solid var(--border);
    padding: 0 20px;
    margin-bottom: 0;
    flex-shrink: 0;
}

.firma-modal-tabs button {
    padding: 10px 20px;
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    cursor: pointer;
    color: var(--muted);
    font-size: 13px;
}

.firma-modal-tabs button.is-active {
    border-bottom-color: var(--accent);
    color: var(--accent);
}

.firma-tab-panel {
    display: none;
    padding: 20px;
    overflow-y: auto;
    flex: 1;
    min-height: 0;
}

.firma-tab-panel.is-visible {
    display: block;
}

.firma-form-section {
    margin-bottom: 20px;
}

.firma-form-section h4,
.firma-form-section .firma-form-section-title {
    margin: 0 0 12px 0;
    font-size: 13px;
    font-weight: 600;
    color: var(--text);
}

.firma-form-section-header {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 12px;
}

.firma-form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px 16px;
    align-items: end;
}

.firma-form-grid .firma-field-span2 {
    grid-column: 1 / -1;
}

@media (max-width: 540px) {
    .firma-form-grid {
        grid-template-columns: 1fr;
    }
}

.firma-list-item {
    padding: 12px;
    margin-bottom: 8px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 10px;
}

.firma-list-item-actions {
    display: flex;
    gap: 6px;
    flex-shrink: 0;
}

.firma-form-section-header--actions {
    align-items: flex-start;
}

.firma-form-header-btns {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
    margin-left: auto;
}

#firma-modal-footer {
    flex-direction: column;
    align-items: stretch;
}

.firma-footer-hint {
    display: none;
    width: 100%;
    margin: 0 0 10px 0;
    font-size: 12px;
    color: var(--muted);
    line-height: 1.45;
}

.firma-modal-footer-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    width: 100%;
}

/* Theme Switcher */
.theme-switcher {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    background: var(--surface2);
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.theme-switcher:hover {
    background: var(--surface3);
}

.theme-toggle {
    width: 44px;
    height: 24px;
    background: var(--border);
    border-radius: 12px;
    position: relative;
    transition: background 0.3s ease;
}

.theme-toggle::after {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    width: 20px;
    height: 20px;
    background: var(--surface);
    border-radius: 50%;
    transition: transform 0.3s ease;
    box-shadow: var(--shadow-sm);
}

[data-theme="light"] .theme-toggle {
    background: var(--accent);
}

[data-theme="light"] .theme-toggle::after {
    transform: translateX(20px);
}

/* Loading & Empty States */
.loading {
    text-align: center;
    padding: 40px 20px;
    color: var(--muted);
    font-size: 13px;
}

.empty {
    text-align: center;
    padding: 60px 20px;
    color: var(--muted);
    font-size: 13px;
}

/* Badges */
.badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
}

.badge-success {
    background: var(--green);
    color: #fff;
}

.badge-danger {
    background: var(--red);
    color: #fff;
}

.badge-warning {
    background: var(--yellow);
    color: #000;
}

.badge-info {
    background: var(--accent);
    color: #fff;
}

/* Utility Classes */
.text-muted {
    color: var(--muted);
}

.text-center {
    text-align: center;
}

.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }
.mb-1 { margin-bottom: 8px; }
.mb-2 { margin-bottom: 16px; }
.mb-3 { margin-bottom: 24px; }
.p-1 { padding: 8px; }
.p-2 { padding: 16px; }
.p-3 { padding: 24px; }

.d-flex {
    display: flex;
}

.align-items-center {
    align-items: center;
}

.justify-content-between {
    justify-content: space-between;
}

.gap-1 { gap: 8px; }
.gap-2 { gap: 16px; }
.gap-3 { gap: 24px; }

/* Log sayfaları (işlem / giriş logları) */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
}

.stats-grid-5 {
    grid-template-columns: repeat(5, minmax(0, 1fr));
}

/* Ana Ekran */
.ana-ekran {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.ana-ekran-hero {
    position: relative;
    overflow: hidden;
    padding: 28px 32px;
    border-radius: calc(var(--radius) + 4px);
    border: 1px solid color-mix(in srgb, var(--accent) 35%, var(--border));
    background:
        radial-gradient(ellipse 80% 120% at 100% 0%, color-mix(in srgb, var(--accent2) 22%, transparent), transparent 55%),
        radial-gradient(ellipse 60% 80% at 0% 100%, color-mix(in srgb, var(--accent) 18%, transparent), transparent 50%),
        linear-gradient(135deg, var(--surface2) 0%, var(--surface) 100%);
    box-shadow: var(--shadow-md);
}

.ana-ekran-hero-inner {
    position: relative;
    z-index: 1;
    max-width: 640px;
}

.ana-ekran-badge {
    display: inline-block;
    padding: 5px 12px;
    margin-bottom: 12px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--accent);
    background: color-mix(in srgb, var(--accent) 14%, transparent);
    border: 1px solid color-mix(in srgb, var(--accent) 30%, transparent);
    border-radius: 999px;
}

.ana-ekran-title {
    margin: 0;
    font-size: clamp(15px, 3vw, 15px);
    font-weight: 800;
    line-height: 1.25;
    color: var(--text);
    letter-spacing: -0.02em;
}

.ana-ekran-subtitle {
    margin: 10px 0 0;
    font-size: 11px;
    line-height: 1.55;
    color: var(--muted);
    max-width: 250ch;
}

.ana-ekran-hero-orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(40px);
    pointer-events: none;
}

.ana-ekran-hero-orb--1 {
    width: 180px;
    height: 180px;
    top: -60px;
    right: 8%;
    background: color-mix(in srgb, var(--accent) 35%, transparent);
    opacity: 0.5;
}

.ana-ekran-hero-orb--2 {
    width: 140px;
    height: 140px;
    bottom: -50px;
    right: 22%;
    background: color-mix(in srgb, var(--accent2) 30%, transparent);
    opacity: 0.4;
}

.stats-grid-ana-ekran {
    gap: 14px;
}

.stats-grid-ana-ekran .stat-card {
    position: relative;
    padding: 18px 18px 16px;
    border-width: 1px;
    border-radius: calc(var(--radius) + 2px);
    background: var(--surface);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.stats-grid-ana-ekran .stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--stat-accent, var(--accent));
}

.stats-grid-ana-ekran .stat-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-md);
    border-color: color-mix(in srgb, var(--stat-accent, var(--accent)) 45%, var(--border));
}

.stat-card--bildirim { --stat-accent: var(--accent); }
.stat-card--barkod   { --stat-accent: var(--cyan); }
.stat-card--lot      { --stat-accent: var(--orange); }
.stat-card--alma     { --stat-accent: var(--green); }
.stat-card--verme    { --stat-accent: var(--accent2); }

.ana-ekran-stat-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 10px;
}

.ana-ekran-stat-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    flex-shrink: 0;
    border-radius: 10px;
    color: var(--stat-accent, var(--accent));
    background: color-mix(in srgb, var(--stat-accent, var(--accent)) 14%, transparent);
}

.ana-ekran-stat-icon svg {
    width: 20px;
    height: 20px;
}

.stats-grid-ana-ekran .ana-ekran-stat-value {
    margin: 0;
    font-size: 32px;
    font-weight: 800;
    letter-spacing: -0.03em;
    line-height: 1;
    color: var(--text);
    text-align: right;
    flex: 1;
}

.stats-grid-ana-ekran .stat-card p {
    margin: 0;
    font-size: 12px;
    font-weight: 700;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.stats-grid-ana-ekran .stat-card.is-loading .ana-ekran-stat-value {
    opacity: 0.35;
    animation: ana-ekran-pulse 1.2s ease-in-out infinite;
}

@keyframes ana-ekran-pulse {
    0%, 100% { opacity: 0.35; }
    50%      { opacity: 0.7; }
}

.ana-ekran-links {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
}

.ana-ekran-link {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 16px 18px;
    text-decoration: none;
    border-radius: calc(var(--radius) + 2px);
    border: 1px solid var(--border);
    background: var(--surface);
    box-shadow: var(--shadow-sm);
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}

.ana-ekran-link:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
    border-color: color-mix(in srgb, var(--accent) 40%, var(--border));
    background: color-mix(in srgb, var(--accent) 6%, var(--surface));
}

.ana-ekran-link-title {
    font-size: 14px;
    font-weight: 700;
    color: var(--text);
}

.ana-ekran-link-desc {
    font-size: 12px;
    line-height: 1.45;
    color: var(--muted);
}

/* Profil sayfası */
.profil-sayfa {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.profil-hero {
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 24px 28px;
    border-radius: calc(var(--radius) + 4px);
    border: 1px solid color-mix(in srgb, var(--accent) 30%, var(--border));
    background:
        radial-gradient(ellipse 70% 100% at 100% 0%, color-mix(in srgb, var(--accent) 16%, transparent), transparent 55%),
        linear-gradient(135deg, var(--surface2) 0%, var(--surface) 100%);
    box-shadow: var(--shadow-md);
}

.profil-hero-avatar {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 72px;
    height: 72px;
    flex-shrink: 0;
    border-radius: 50%;
    font-size: 24px;
    font-weight: 800;
    letter-spacing: 0.02em;
    color: #fff;
    background: linear-gradient(135deg, var(--accent) 0%, var(--accent2) 100%);
    box-shadow: 0 8px 24px color-mix(in srgb, var(--accent) 35%, transparent);
}

.profil-hero-info {
    min-width: 0;
}

.profil-hero-badge {
    display: inline-block;
    padding: 4px 10px;
    margin-bottom: 8px;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--accent);
    background: color-mix(in srgb, var(--accent) 12%, transparent);
    border: 1px solid color-mix(in srgb, var(--accent) 28%, transparent);
    border-radius: 999px;
}

.profil-hero-title {
    margin: 0;
    font-size: clamp(20px, 2.5vw, 26px);
    font-weight: 800;
    line-height: 1.25;
    color: var(--text);
    letter-spacing: -0.02em;
}

.profil-hero-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    margin: 8px 0 0;
    font-size: 13px;
    color: var(--muted);
}

.profil-hero-dot {
    opacity: 0.5;
}

.profil-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
    align-items: start;
}

.profil-panel {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: calc(var(--radius) + 2px);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
}

.profil-panel-head {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    padding: 18px 20px;
    border-bottom: 1px solid var(--border);
    background: var(--surface2);
}

.profil-panel-head h2 {
    margin: 0;
    font-size: 15px;
    font-weight: 700;
    color: var(--text);
}

.profil-panel-head p {
    margin: 4px 0 0;
    font-size: 12px;
    line-height: 1.45;
    color: var(--muted);
}

.profil-panel-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    flex-shrink: 0;
    border-radius: 10px;
    color: var(--accent);
    background: color-mix(in srgb, var(--accent) 14%, transparent);
}

.profil-panel-icon--sifre {
    color: var(--orange);
    background: color-mix(in srgb, var(--orange) 14%, transparent);
}

.profil-panel-icon svg {
    width: 20px;
    height: 20px;
}

.profil-form {
    padding: 20px;
}

.profil-form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px 16px;
}

.profil-form-grid--single {
    grid-template-columns: 1fr;
}

.profil-form-span2 {
    grid-column: span 2;
}

.profil-form-actions {
    display: flex;
    justify-content: flex-end;
    margin-top: 18px;
    padding-top: 16px;
    border-top: 1px solid var(--border);
}

.profil-form-actions .btn-primary {
    min-width: 160px;
}

@media (max-width: 900px) {
    .profil-grid {
        grid-template-columns: 1fr;
    }

    .profil-hero {
        flex-direction: column;
        align-items: flex-start;
        padding: 20px;
    }
}

@media (max-width: 520px) {
    .profil-form-grid {
        grid-template-columns: 1fr;
    }

    .profil-form-span2 {
        grid-column: span 1;
    }

    .profil-form-actions .btn-primary {
        width: 100%;
    }
}

.stat-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 14px 16px;
}

.stat-card h3 {
    margin: 0;
    font-size: 22px;
    font-weight: 700;
    color: var(--accent);
    line-height: 1.2;
}

.stat-card p {
    margin: 6px 0 0;
    font-size: 12px;
    color: var(--muted);
    font-weight: 500;
}

@media (max-width: 900px) {
    .stats-grid,
    .stats-grid-5 {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .ana-ekran-hero {
        padding: 22px 20px;
    }

    .stats-grid-ana-ekran .ana-ekran-stat-value {
        font-size: 26px;
    }

    .ana-ekran-links {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 520px) {
    .ana-ekran-links {
        grid-template-columns: 1fr;
    }
}

.log-filter-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 12px 16px;
    align-items: end;
}

/* DataTableShell stilleri: theme_1/css/data-table.css */

.table-wrap-log {
    overflow-x: auto;
}

.log-pagination-wrap {
    padding: 12px 16px;
    border-top: 1px solid var(--border);
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    background: var(--surface2);
}

.log-pagination-wrap button {
    padding: 6px 12px;
    font-size: 12px;
}

.log-pagination-wrap .log-page-ellipsis {
    padding: 6px 4px;
    color: var(--muted);
    font-size: 12px;
}

.modal-content--log-wide {
    max-width: 900px;
}

.log-meta-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 12px 16px;
}

.log-meta-grid > div > div:first-child {
    font-size: 11px;
    color: var(--muted);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    margin-bottom: 4px;
}

.log-json-split {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-top: 16px;
}

@media (max-width: 700px) {
    .log-json-split {
        grid-template-columns: 1fr;
    }
}

/* ============================================================
 * ROL İZİN YÖNETİMİ (/roles)
 * ============================================================ */
.roles-page .card {
    margin-bottom: 0;
}

.roles-layout {
    display: grid;
    grid-template-columns: minmax(280px, 340px) 1fr;
    gap: 16px;
    align-items: start;
}

.roles-sidebar {
    display: flex;
    flex-direction: column;
    min-height: 420px;
}

.roles-list-body {
    padding: 0;
    flex: 1;
    overflow: hidden;
}

.roles-list {
    max-height: min(60vh, 520px);
    overflow-y: auto;
}

.roles-list-empty {
    padding: 24px 16px;
    text-align: center;
    font-size: 13px;
}

.roles-sidebar-note {
    padding: 10px 16px 14px;
    font-size: 11px;
    color: var(--muted);
    border-top: 1px solid var(--border);
    display: flex;
    align-items: flex-start;
    gap: 8px;
    line-height: 1.45;
}

.roles-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}

.roles-toolbar-wrap {
    justify-content: flex-end;
}

.roles-perms-card {
    min-height: 420px;
    display: flex;
    flex-direction: column;
}

.roles-empty-state {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 48px 24px;
    min-height: 360px;
}

.roles-empty-icon {
    font-size: 40px;
    margin-bottom: 12px;
    opacity: 0.85;
}

.roles-empty-state p {
    margin: 4px 0;
    font-size: 13px;
}

.roles-perms-panel {
    display: flex;
    flex-direction: column;
    flex: 1;
    width: 100%;
}

.roles-perms-header {
    flex-wrap: wrap;
}

.roles-secili-ad {
    color: var(--accent);
}

.roles-perms-body {
    padding-top: 12px;
}

.roles-perms-hint {
    font-size: 12px;
    margin: 0 0 12px;
    line-height: 1.5;
}

.roles-hint-sep {
    margin: 0 8px;
    opacity: 0.5;
}

.roles-info-box {
    padding: 12px 14px;
    margin-bottom: 12px;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    background: var(--surface2);
    font-size: 12px;
    line-height: 1.5;
    color: var(--text);
}

.roles-form-hint {
    display: block;
    margin-top: 6px;
    font-size: 11px;
    color: var(--muted);
    font-weight: 400;
    text-transform: none;
    letter-spacing: 0;
}

.rol-item {
    display: flex;
    align-items: stretch;
    gap: 0;
    border-bottom: 1px solid var(--border);
    transition: background 0.15s ease;
}

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

.rol-item:hover {
    background: var(--surface2);
}

.rol-item--active {
    background: color-mix(in srgb, var(--accent) 12%, var(--surface2));
    border-left: 3px solid var(--accent);
}

.rol-item-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
    padding: 12px 14px;
    border: none;
    background: none;
    color: var(--text);
    text-align: left;
    cursor: pointer;
    font-family: inherit;
    min-width: 0;
}

.rol-item-main:hover:not(:disabled) {
    background: none !important;
    border-color: transparent !important;
    box-shadow: none !important;
    transform: none;
}

.rol-item-title {
    font-weight: 600;
    font-size: 13px;
    word-break: break-word;
}

.rol-item-desc {
    font-size: 11px;
    line-height: 1.35;
}

.rol-item-badge {
    align-self: flex-start;
}

.rol-item-actions {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 6px;
    padding: 8px 10px 8px 0;
    flex-shrink: 0;
}

.rol-item-btn {
    padding: 5px 10px !important;
    font-size: 11px !important;
    white-space: nowrap;
}

.roles-matrix-shell {
    margin-top: 4px;
}

.roles-matrix-table {
    width: 100%;
    min-width: 720px;
    border-collapse: collapse;
    font-size: 12px;
}

.roles-matrix-table th,
.roles-matrix-table td {
    border: 1px solid var(--border);
    padding: 8px 10px;
    text-align: center;
    vertical-align: middle;
}

.roles-matrix-table thead th {
    background: var(--surface2);
    font-weight: 600;
    color: var(--text);
    white-space: nowrap;
}

.roles-matrix-subhead th {
    font-size: 10px;
    font-weight: 500;
    color: var(--muted);
    padding: 4px 6px;
}

.roles-matrix-sticky {
    position: sticky;
    left: 0;
    z-index: 2;
    background: var(--surface);
    text-align: left !important;
    min-width: 140px;
}

.roles-matrix-table thead .roles-matrix-sticky {
    background: var(--surface2);
    z-index: 3;
}

.roles-matrix-modul strong {
    font-size: 12px;
}

.roles-matrix-check input[type="checkbox"] {
    width: 16px;
    height: 16px;
    cursor: pointer;
    accent-color: var(--accent);
}

.izin-panel-tam-yonetici .roles-matrix-check input[type="checkbox"]:disabled {
    opacity: 0.75;
    cursor: not-allowed;
}

@media (max-width: 960px) {
    .roles-layout {
        grid-template-columns: 1fr;
    }

    .roles-sidebar {
        min-height: auto;
    }

    .roles-list {
        max-height: 280px;
    }

    .roles-perms-header .roles-toolbar-wrap {
        width: 100%;
        justify-content: flex-start;
    }
}

/* ── Proje Lisansı ── */
.lisans-uyari-band a {
    margin-left: 8px;
    color: inherit;
    font-weight: 600;
    text-decoration: underline;
}

.lisans-panel {
    max-width: 900px;
}

.lisans-hero {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 20px 24px;
    border-radius: 12px;
    margin-bottom: 20px;
    border: 1px solid var(--border);
}

.lisans-hero--ok {
    background: linear-gradient(135deg, rgba(34, 197, 94, 0.12), rgba(34, 197, 94, 0.04));
}

.lisans-hero--bad {
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.12), rgba(239, 68, 68, 0.04));
}

.lisans-hero-icon svg {
    width: 40px;
    height: 40px;
}

.lisans-hero--ok .lisans-hero-icon { color: #22c55e; }
.lisans-hero--bad .lisans-hero-icon { color: #ef4444; }

.lisans-hero h3 {
    margin: 0 0 4px;
    font-size: 18px;
}

.lisans-hero p {
    margin: 0;
    color: var(--text-muted);
    font-size: 14px;
}

.lisans-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 12px;
    margin-bottom: 16px;
}

.lisans-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 14px 16px;
}

.lisans-card--wide {
    margin-bottom: 12px;
}

.lisans-label {
    display: block;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-muted);
    margin-bottom: 6px;
}

.lisans-info-text {
    font-size: 13px;
    color: var(--text-muted);
    margin-top: 20px;
}

.license-expired-body {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background: var(--bg);
}

.license-expired-wrap {
    width: 100%;
    max-width: 480px;
}

.license-expired-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 32px;
    text-align: center;
    box-shadow: var(--shadow-lg);
}

.license-expired-icon {
    color: #ef4444;
    margin-bottom: 16px;
}

.license-expired-icon svg {
    width: 56px;
    height: 56px;
}

.license-expired-card h1 {
    font-size: 22px;
    margin: 0 0 12px;
}

.license-expired-message {
    color: var(--text-muted);
    font-size: 15px;
    line-height: 1.6;
    margin-bottom: 20px;
}

.license-expired-details {
    text-align: left;
    background: var(--surface2);
    border-radius: 10px;
    padding: 14px 16px;
    margin-bottom: 16px;
}

.license-expired-details div {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    font-size: 14px;
    padding: 6px 0;
}

.license-expired-details span {
    color: var(--text-muted);
}

.license-expired-hint {
    font-size: 13px;
    color: var(--text-muted);
    line-height: 1.5;
    margin-bottom: 24px;
}

.license-expired-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
    flex-wrap: wrap;
}

.license-expired-actions form {
    margin: 0;
}

/* ── Rol firma erişimi ── */
.roles-firm-panel {
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid var(--border);
}

.roles-firm-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 12px;
}

.roles-firm-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 8px;
    max-height: 220px;
    overflow-y: auto;
    padding: 12px;
    background: var(--surface2);
    border-radius: 10px;
    border: 1px solid var(--border);
}

.roles-firm-item {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    font-size: 13px;
    cursor: pointer;
    padding: 6px 8px;
    border-radius: 6px;
}

.roles-firm-item:hover {
    background: var(--surface);
}

.roles-firm-item input {
    margin-top: 2px;
    accent-color: var(--accent);
}
