/* Teklif Yönetim — uygulama teması */
:root {
    --primary: #2563eb;
    --primary-dark: #1d4ed8;
    --sidebar-bg: #0f172a;
    --sidebar-hover: #1e293b;
    --sidebar-active: #2563eb;
    --body-bg: #f1f5f9;
    --card-bg: #ffffff;
    --text: #0f172a;
    --text-muted: #64748b;
    --border: #e2e8f0;
    --radius: 0.75rem;
    --radius-lg: 1rem;
    --shadow: 0 1px 3px rgba(15, 23, 42, 0.06);
    --shadow-md: 0 10px 25px -5px rgba(15, 23, 42, 0.08);
}

* { box-sizing: border-box; }

body {
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    color: var(--text);
    background: var(--body-bg);
    min-height: 100vh;
}

/* ——— Auth (giriş / kayıt) ——— */
body.auth-page {
    margin: 0;
    background: linear-gradient(135deg, #0f172a 0%, #1e3a8a 45%, #2563eb 100%);
}

.auth-shell {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
    position: relative;
    overflow: hidden;
}

.auth-shell::before,
.auth-shell::after {
    content: "";
    position: absolute;
    border-radius: 50%;
    filter: blur(60px);
    opacity: 0.35;
    pointer-events: none;
}

.auth-shell::before {
    width: 320px;
    height: 320px;
    background: #60a5fa;
    top: -80px;
    right: -60px;
}

.auth-shell::after {
    width: 280px;
    height: 280px;
    background: #818cf8;
    bottom: -60px;
    left: -40px;
}

.auth-card-wrap {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 420px;
}

.auth-card {
    background: rgba(255, 255, 255, 0.97);
    border-radius: 1.25rem;
    box-shadow: 0 25px 50px -12px rgba(15, 23, 42, 0.45);
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.auth-card-header {
    background: linear-gradient(135deg, #1e40af, #2563eb);
    color: #fff;
    padding: 2rem 2rem 1.75rem;
    text-align: center;
}

.auth-card-header .brand-icon {
    width: 56px;
    height: 56px;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.15);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.75rem;
    margin-bottom: 0.75rem;
}

.auth-card-header h1 {
    font-size: 1.5rem;
    font-weight: 700;
    margin: 0 0 0.25rem;
    letter-spacing: -0.02em;
}

.auth-card-header p {
    margin: 0;
    opacity: 0.9;
    font-size: 0.9rem;
}

.auth-card-body {
    padding: 1.75rem 2rem 2rem;
}

.auth-input-group {
    position: relative;
    margin-bottom: 1.1rem;
}

.auth-input-group .input-icon {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: #64748b;
    font-size: 1.1rem;
    pointer-events: none;
}

.auth-input-group .form-control {
    padding: 0.75rem 1rem 0.75rem 2.75rem;
    border-radius: var(--radius);
    border: 1px solid var(--border);
}

.auth-input-group .form-control:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

.auth-remember {
    background: #f8fafc;
    border-radius: var(--radius);
    padding: 0.85rem 1rem;
    margin-bottom: 1.25rem;
    border: 1px solid var(--border);
}

.btn-auth-submit {
    width: 100%;
    padding: 0.85rem;
    font-size: 1.05rem;
    font-weight: 600;
    border: none;
    border-radius: var(--radius);
    background: linear-gradient(135deg, #1d4ed8, #2563eb);
    color: #fff;
    box-shadow: 0 4px 14px rgba(37, 99, 235, 0.4);
    transition: transform 0.15s, box-shadow 0.15s;
}

.btn-auth-submit:hover {
    color: #fff;
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(37, 99, 235, 0.45);
}

.auth-footer {
    text-align: center;
    margin-top: 1.25rem;
    padding-top: 1.25rem;
    border-top: 1px solid var(--border);
    color: var(--text-muted);
}

.auth-footer a {
    color: var(--primary);
    font-weight: 600;
    text-decoration: none;
}

.auth-alert {
    border-radius: var(--radius);
    font-size: 0.9rem;
}

/* ——— Panel düzeni ——— */
.app-shell {
    display: flex;
    min-height: 100vh;
}

.app-sidebar {
    width: 260px;
    flex-shrink: 0;
    background: linear-gradient(180deg, #0f172a 0%, #1e293b 100%);
    color: #e2e8f0;
    display: flex;
    flex-direction: column;
    padding: 1.25rem 0;
    box-shadow: 4px 0 24px rgba(15, 23, 42, 0.12);
}

.sidebar-brand {
    padding: 0 1.25rem 1.25rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    margin-bottom: 1rem;
}

.sidebar-brand-link {
    color: #fff;
    text-decoration: none;
    font-weight: 700;
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.sidebar-brand-link i {
    font-size: 1.35rem;
    color: #60a5fa;
    flex-shrink: 0;
}

.sidebar-brand-link--logo {
    display: block;
    line-height: 0;
}

.sidebar-brand-logo {
    display: block;
    max-height: 52px;
    max-width: 100%;
    width: auto;
    height: auto;
    object-fit: contain;
    object-position: left center;
}

.sidebar-user {
    padding: 0 1.25rem 1rem;
    font-size: 0.85rem;
    color: #94a3b8;
}

.sidebar-user strong {
    display: block;
    color: #f1f5f9;
    font-size: 0.95rem;
    margin-top: 0.15rem;
}

.sidebar-nav {
    flex: 1;
    padding: 0 0.75rem;
}

.sidebar-nav a {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    color: #cbd5e1;
    text-decoration: none;
    padding: 0.65rem 1rem;
    border-radius: var(--radius);
    margin-bottom: 0.2rem;
    font-size: 0.95rem;
    transition: background 0.15s, color 0.15s;
}

.sidebar-nav a i {
    font-size: 1.15rem;
    opacity: 0.9;
}

.sidebar-nav a:hover {
    background: var(--sidebar-hover);
    color: #fff;
}

.sidebar-nav a.active {
    background: linear-gradient(135deg, #1d4ed8, #2563eb);
    color: #fff;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.35);
}

.sidebar-nav a.nav-sub {
    padding-left: 2.25rem;
    font-size: 0.88rem;
}

.sidebar-footer {
    padding: 1rem 0.75rem 0;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    margin-top: auto;
}

.sidebar-footer a {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: #94a3b8;
    text-decoration: none;
    padding: 0.6rem 1rem;
    border-radius: var(--radius);
    font-size: 0.9rem;
}

.sidebar-footer a:hover {
    background: rgba(239, 68, 68, 0.15);
    color: #fca5a5;
}

.app-main {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.app-content {
    flex: 1;
    padding: 1.75rem 2rem 2.5rem;
}

/* Sayfa başlığı */
.page-header {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.page-header h1,
.page-header h2,
.app-content > h2:first-child {
    font-size: 1.65rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    margin: 0;
    color: var(--text);
}

.page-header .text-muted,
.app-content > h2 small {
    font-weight: 400;
    color: var(--text-muted) !important;
}

/* Kartlar */
.card {
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    background: var(--card-bg);
    box-shadow: var(--shadow);
    overflow: hidden;
}

.card.p-3,
.card.p-4 {
    padding: 1.25rem !important;
}

.card h5 {
    font-weight: 600;
    color: var(--text);
}

/* Tablolar */
.table {
    margin-bottom: 0;
}

.table thead th {
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-muted);
    background: #f8fafc;
    border-bottom: 1px solid var(--border);
    padding: 0.85rem 1rem;
    white-space: nowrap;
}

.table tbody td {
    padding: 0.9rem 1rem;
    vertical-align: middle;
    border-color: #f1f5f9;
}

.table-hover tbody tr:hover {
    background: #f8fafc;
}

/* Formlar */
.form-control,
.form-select {
    border-radius: var(--radius);
    border-color: var(--border);
    padding: 0.55rem 0.85rem;
}

.form-control:focus,
.form-select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

.form-label {
    font-weight: 500;
    color: #334155;
    font-size: 0.9rem;
}

/* Butonlar */
.btn {
    border-radius: var(--radius);
    font-weight: 500;
    padding: 0.5rem 1rem;
}

.btn-primary {
    background: linear-gradient(135deg, #1d4ed8, #2563eb);
    border: none;
    box-shadow: 0 2px 8px rgba(37, 99, 235, 0.3);
}

.btn-primary:hover {
    background: linear-gradient(135deg, #1e40af, #1d4ed8);
    border: none;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.35);
}

.btn-success {
    background: linear-gradient(135deg, #059669, #10b981);
    border: none;
}

.btn-outline-primary {
    border-color: var(--primary);
    color: var(--primary);
}

.btn-outline-primary:hover {
    background: var(--primary);
    border-color: var(--primary);
}

/* Rozetler */
.badge {
    font-weight: 500;
    padding: 0.4em 0.65em;
    border-radius: 0.5rem;
}

.badge.bg-secondary {
    background: #e2e8f0 !important;
    color: #475569 !important;
}

/* Uyarılar */
.alert {
    border: none;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.alert-success {
    background: #ecfdf5;
    color: #047857;
}

.alert-danger {
    background: #fef2f2;
    color: #b91c1c;
}

/* İstatistik kartları */
.stat-card {
    border-radius: var(--radius-lg);
    padding: 1.35rem;
    background: var(--card-bg);
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
    transition: transform 0.15s, box-shadow 0.15s;
    height: 100%;
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.stat-card .stat-label {
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
}

.stat-card .stat-value {
    font-size: 2rem;
    font-weight: 700;
    color: var(--text);
    line-height: 1.2;
    margin: 0.35rem 0 0.5rem;
}

.stat-card .stat-link {
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--primary);
    text-decoration: none;
}

.stat-card .stat-icon {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    margin-bottom: 0.75rem;
}

.stat-card.stat-products .stat-icon { background: #dbeafe; color: #2563eb; }
.stat-card.stat-categories .stat-icon { background: #e0e7ff; color: #4f46e5; }
.stat-card.stat-customers .stat-icon { background: #fce7f3; color: #db2777; }
.stat-card.stat-quotes .stat-icon { background: #d1fae5; color: #059669; }

/* Görseller */
.product-thumb,
.quote-line-img {
    object-fit: cover;
    border-radius: 8px;
    border: 1px solid var(--border);
}

.product-thumb {
    width: 48px;
    height: 48px;
}

.quote-line-img {
    width: 56px;
    height: 56px;
}

.bg-light.rounded {
    background: #f8fafc !important;
    border: 1px dashed var(--border);
}

/* Mobil */
@media (max-width: 991.98px) {
    .app-shell {
        flex-direction: column;
    }

    .app-sidebar {
        width: 100%;
        min-height: auto;
        padding: 1rem 0;
    }

    .sidebar-nav {
        display: flex;
        flex-wrap: wrap;
        gap: 0.35rem;
        padding: 0 0.75rem;
    }

    .sidebar-nav a {
        flex: 1 1 calc(50% - 0.35rem);
        min-width: calc(50% - 0.35rem);
        max-width: calc(50% - 0.35rem);
        justify-content: flex-start;
        align-items: center;
        font-size: 0.82rem;
        padding: 0.55rem 0.65rem;
        gap: 0.5rem;
    }

    .sidebar-nav a i {
        width: 1.35rem;
        min-width: 1.35rem;
        flex-shrink: 0;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        font-size: 1.1rem;
    }

    .sidebar-nav a .badge {
        margin-left: auto;
        flex-shrink: 0;
    }

    .sidebar-nav a.nav-sub {
        padding-left: 0.65rem;
    }

    .sidebar-footer {
        border-top: none;
        padding-top: 0;
        display: flex;
        flex-wrap: wrap;
        gap: 0.35rem;
        justify-content: center;
    }

    .sidebar-footer a {
        flex: 1 1 calc(50% - 0.35rem);
        min-width: calc(50% - 0.35rem);
        max-width: calc(50% - 0.35rem);
        justify-content: flex-start;
        padding: 0.55rem 0.65rem;
        gap: 0.5rem;
    }

    .sidebar-footer a i {
        width: 1.35rem;
        min-width: 1.35rem;
        flex-shrink: 0;
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }

    .sidebar-footer a:only-child {
        max-width: 100%;
        justify-content: center;
    }

    .app-content {
        padding: 1.25rem 1rem 2rem;
    }

    .quotes-table-scroll {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .btn-pdf-mobile {
        min-height: 44px;
    }
}

/* Teklifler — mobil kart listesi */
.quote-mobile-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.quote-mobile-card {
    background: var(--card-bg-solid, #fff);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 1rem;
    box-shadow: var(--shadow);
}

.quote-mobile-card-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 0.75rem;
    margin-bottom: 0.5rem;
}

.quote-mobile-number {
    font-weight: 700;
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-bottom: 0.15rem;
}

.quote-mobile-card-head-end {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0.35rem;
    flex-shrink: 0;
}

.quote-done-label {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    margin: 0;
    cursor: pointer;
    white-space: nowrap;
}

.quote-mobile-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem 1rem;
    margin-bottom: 0.75rem;
}

.quote-list-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
}

.quote-list-actions--mobile .btn {
    flex: 1 1 calc(50% - 0.25rem);
    min-height: 44px;
    justify-content: center;
}

.quote-list-actions--mobile form {
    flex: 1 1 calc(50% - 0.25rem);
    display: flex;
}

.quote-list-actions--mobile form .btn {
    flex: 1;
    width: 100%;
}

.quote-list-actions--desktop {
    justify-content: flex-end;
    flex-wrap: nowrap;
}

.quote-list-actions--desktop .btn,
.quote-list-actions--desktop form {
    flex-shrink: 0;
}

/* ——— Yapılacaklar ——— */
.todo-tabs .nav-link {
    border-radius: 999px;
    color: var(--text-muted);
    font-weight: 500;
    padding: 0.5rem 1rem;
}

.todo-tabs .nav-link.active {
    background: linear-gradient(135deg, #1d4ed8, #2563eb);
    color: #fff;
}

.todo-tabs .badge {
    background: rgba(255, 255, 255, 0.25);
    color: inherit;
}

.todo-tabs .nav-link:not(.active) .badge {
    background: #e2e8f0;
    color: #475569;
}

.todo-list {
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
}

.todo-item {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 1rem 1.1rem;
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    transition: box-shadow 0.15s, border-color 0.15s;
}

.todo-item:hover {
    box-shadow: var(--shadow-md);
}

.todo-item-overdue {
    border-color: #fecaca;
    background: linear-gradient(135deg, #fff 0%, #fef2f2 100%);
}

.todo-item-done {
    opacity: 0.85;
    background: #f8fafc;
}

.todo-check-form {
    margin: 0;
    padding-top: 0.15rem;
}

.todo-check-btn {
    border: none;
    background: none;
    padding: 0;
    font-size: 1.35rem;
    line-height: 1;
    color: #94a3b8;
    cursor: pointer;
}

.todo-check-btn:hover {
    color: var(--primary);
}

.todo-title {
    font-weight: 600;
    font-size: 1.05rem;
    color: var(--text);
}

.todo-priority-badge.todo-priority-high {
    background: #fee2e2;
    color: #b91c1c;
}

.todo-priority-badge.todo-priority-medium {
    background: #dbeafe;
    color: #1d4ed8;
}

.todo-priority-badge.todo-priority-low {
    background: #f1f5f9;
    color: #64748b;
}

.sidebar-nav .badge {
    font-size: 0.7rem;
    vertical-align: middle;
}

.customer-name-link {
    text-decoration: none;
    color: inherit;
    border-bottom: 1px dashed transparent;
    transition: color 0.15s, border-color 0.15s;
}

.customer-name-link:hover {
    color: var(--primary);
    border-bottom-color: var(--primary);
}

.page-header .customer-name-link:hover {
    color: var(--primary);
}

/* Ayarlar — kategorili düzen */
.settings-nav {
    top: 1rem;
}

.settings-nav-title {
    letter-spacing: 0.04em;
    font-weight: 600;
}

.settings-nav-link {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.55rem 0.75rem;
    border-radius: var(--radius);
    color: var(--text);
    text-decoration: none;
    font-size: 0.92rem;
    margin-bottom: 0.15rem;
    transition: background 0.15s, color 0.15s;
}

.settings-nav-link:hover {
    background: #f1f5f9;
    color: var(--primary);
}

.settings-nav-link.active {
    background: linear-gradient(135deg, #eff6ff, #dbeafe);
    color: #1d4ed8;
    font-weight: 600;
}

.settings-nav-link i {
    width: 1.25rem;
    text-align: center;
    opacity: 0.85;
}

@media (max-width: 991.98px) {
    .settings-nav {
        position: static !important;
        display: flex;
        flex-wrap: wrap;
        gap: 0.35rem;
    }

    .settings-nav-title {
        width: 100%;
    }

    .settings-nav-link {
        flex: 1 1 auto;
        font-size: 0.82rem;
        padding: 0.45rem 0.6rem;
    }
}

/* Teklifler — yapıldı */
.quote-done-form {
    margin: 0;
    padding: 0;
    vertical-align: middle;
}

.quote-done-check {
    width: 1.15rem;
    height: 1.15rem;
    margin: 0;
    cursor: pointer;
}

.quote-row-done td {
    background: #f0fdf4;
}

.quote-row-done .quote-done-check {
    border-color: #16a34a;
    background-color: #16a34a;
}

/* ——— Müşteri arama (Veresiye) ——— */
.customer-search-wrap {
    position: relative;
}

/* Bootstrap modal: tıklamalar yalnızca diyalogda (mobil dahil) */
.modal {
    pointer-events: none;
}

.modal-dialog {
    pointer-events: auto;
}

.modal .customer-search-results {
    z-index: 1060;
}

.modal .customer-search-results:not(.show) {
    pointer-events: none;
}

.customer-search-results {
    display: none;
    position: absolute;
    z-index: 1050;
    left: 0;
    right: 0;
    top: calc(100% + 4px);
    max-height: 240px;
    overflow-y: auto;
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-md);
}

.customer-search-results.show {
    display: block;
}

.customer-search-item {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    width: 100%;
    padding: 0.65rem 0.85rem;
    border: none;
    border-bottom: 1px solid var(--border);
    background: transparent;
    text-align: left;
    cursor: pointer;
}

.customer-search-item:last-child {
    border-bottom: none;
}

.customer-search-item:hover,
.customer-search-item:focus {
    background: #eff6ff;
    outline: none;
}

.customer-search-name {
    font-weight: 600;
    color: var(--text);
}

.customer-search-meta {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: 0.15rem;
}

.customer-search-empty {
    padding: 0.75rem 0.85rem;
    color: var(--text-muted);
    font-size: 0.9rem;
}

.customer-lookup-card {
    background: linear-gradient(135deg, #fff 0%, #f8fafc 100%);
    border: 1px solid var(--border);
}

.customer-search-preview {
    margin-top: 1rem;
}

.customer-search-preview-inner {
    padding: 1rem 1.1rem;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
}

.customer-search-preview-title {
    font-weight: 700;
    font-size: 1.1rem;
    margin-bottom: 0.75rem;
}

.customer-search-stat-label {
    display: block;
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.customer-search-stat-value {
    display: block;
    font-weight: 700;
    font-size: 1rem;
    margin-top: 0.2rem;
}

.customer-search-item .customer-search-meta strong {
    font-weight: 700;
}
