:root {
    --primary: #007bff;
    --primary-soft: #e7f1ff;
    --success: #28a745;
    --warning: #ffc107;
    --danger: #dc3545;
    --bg-gray: #f8f9fa;
    --white: #ffffff;
    --text-dark: #333333;
    --text-muted: #6c757d;
    --radius: 14px;
    --shadow: 0 4px 20px rgba(0, 0, 0, 0.04);
    --shadow-hover: 0 6px 30px rgba(0, 0, 0, 0.08);
    --z-index-login: 3000;
}
/* Improved Modern Toggle Switch */
.switch {
  position: relative;
  display: inline-block;
  width: 50px;
  height: 26px;
}

.switch input { 
  opacity: 0;
  width: 0;
  height: 0;
}

.slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #cbd5e1;
  transition: .3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: inset 0 2px 4px rgba(0,0,0,0.05);
}

.slider:before {
  position: absolute;
  content: "";
  height: 20px;
  width: 20px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: .3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

input:checked + .slider {
  background-color: #22c55e; /* Success Green */
}

input:focus + .slider {
  box-shadow: 0 0 1px #22c55e;
}

input:checked + .slider:before {
  transform: translateX(24px);
}

/* Rounded sliders */
.slider.round {
  border-radius: 34px;
}

.slider.round:before {
  border-radius: 50%;
}

/* Fix for mobile auto-zoom on focus */
@media (max-width: 768px) {
    input, select, textarea { font-size: 16px !important; }
}

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

/* Layout */
html, body {
    margin: 0 !important;
    padding: 0 !important;
    width: 100% !important;
    overflow-x: hidden;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background-color: var(--bg-gray);
    color: var(--text-dark);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    margin: 0;
    padding: 0;
}

/* Layout */
.container {
    width: 100vw !important;
    max-width: 100vw !important;
    margin: 0 !important;
    padding: 10px 20px !important;
}

#main-content, #admin-view, #admin-dashboard-tab {
    width: 100% !important;
}

@media (max-width: 600px) {
    .container {
        padding: 12px;
    }
}

.mobile-only { display: none !important; }
.desktop-only-badges { display: inline-flex; gap: 4px; vertical-align: middle; }
.mobile-only-badges { display: none !important; }

@media (max-width: 768px) {
    .mobile-only { display: block !important; }
    .desktop-only-badges { display: none !important; }
    .mobile-only-badges { display: inline-flex !important; align-items: center; gap: 4px; }
}

.view-section {
    display: none;
    animation: fadeIn 0.4s ease;
    width: 100% !important;
}

.view-active {
    display: block;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Navigation for Demo */
.nav-panel {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 32px;
    background: var(--white);
    padding: 12px 24px;
    border-radius: 12px;
    box-shadow: var(--shadow);
    width: 100% !important;
    margin-left: 0;
    margin-right: 0;
    border: 1px solid rgba(0,0,0,0.02);
}

.btn-toggle {
    background: transparent;
    border: none;
    padding: 10px 24px;
    border-radius: 40px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    color: var(--text-muted);
}

.btn-toggle.active {
    background: var(--primary);
    color: white;
    box-shadow: 0 4px 12px rgba(0, 123, 255, 0.2);
}

/* Card Component */
.card {
    background: var(--white);
    border-radius: var(--radius);
    padding: 20px;
    box-shadow: var(--shadow);
    margin-bottom: 24px;
    border: 1px solid rgba(0,0,0,0.02);
    transition: box-shadow 0.3s ease;
    width: 100% !important;
}

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

.card-title {
    font-size: 1.15rem;
    font-weight: 700;
    margin-bottom: 20px;
    color: var(--text-dark);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* Button Component */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 24px;
    border-radius: var(--radius);
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    border: none;
    font-size: 0.95rem;
    gap: 10px;
    white-space: nowrap;
}

.btn:active { transform: scale(0.98); }

.btn-primary { background: linear-gradient(135deg, #007bff, #0056b3); color: white; }
.btn-success { background: linear-gradient(135deg, #28a745, #1e7e34); color: white; }
.btn-warning { background: linear-gradient(135deg, #ffc107, #e0a800); color: black; }
.btn-outline { background: transparent; border: 1.5px solid #eee; color: var(--text-dark); }
.btn-outline:hover { border-color: var(--primary); color: var(--primary); }

.btn-block { width: 100%; }
.btn-lg { padding: 18px 32px; font-size: 1.1rem; border-radius: 16px; }

@media (max-width: 600px) {
    .btn-lg {
        padding: 12px 20px;
        font-size: 1rem;
        border-radius: 12px;
    }
}

/* Badges */
.badge {
    padding: 6px 12px;
    border-radius: 40px;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.4px;
}

.badge-pending { background: #fff8e1; color: #b78103; }
.badge-delivered { background: #e8f5e9; color: #2e7d32; }
.badge-nakit { background: #fee2e2; color: #dc2626; }
.badge-cari { background: #fff8e1; color: #b78103; }
.badge-kredi-karti { background: #e3f2fd; color: #1565c0; }

/* New Customer Badge (Animated) */
.new-customer-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: linear-gradient(135deg, #6e45e2, #88d3ce);
    color: white;
    padding: 4px 10px;
    border-radius: 50px;
    font-size: 0.7rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-shadow: 0 4px 15px rgba(110, 69, 226, 0.4);
    animation: badge-pulse 2s infinite, badge-glow 1.5s ease-in-out infinite alternate;
    border: 1px solid rgba(255, 255, 255, 0.3);
    margin-left: 8px;
    vertical-align: middle;
}

@keyframes badge-pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

@keyframes badge-glow {
    from { box-shadow: 0 0 5px #6e45e2, 0 0 10px #6e45e2; }
    to { box-shadow: 0 0 10px #88d3ce, 0 0 20px #88d3ce; }
}

/* Problematic Task Badge (Animated Orange) */
.problematic-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: linear-gradient(135deg, #f59e0b, #fbbf24);
    color: #451a03;
    padding: 2px 8px;
    border-radius: 50px;
    font-size: 0.65rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-shadow: 0 4px 15px rgba(245, 158, 11, 0.3);
    animation: badge-pulse 2s infinite;
    border: 1px solid rgba(255, 255, 255, 0.4);
    margin-left: 6px;
    vertical-align: middle;
}

/* Table Style (Admin) */
.table-container {
    background: white;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow: hidden;
    width: 100%;
}

.table-responsive {
    overflow-x: auto;
    width: 100%;
}

table {
    width: 100%;
    border-collapse: collapse;
    table-layout: fixed; /* Force fixed column widths */
}

th {
    background: #fafafa;
    text-align: left;
    padding: 10px 12px;
    font-size: 0.75rem;
    color: var(--text-muted);
    font-weight: 700;
    text-transform: uppercase;
    border-bottom: 2px solid #eee;
}

td {
    padding: 8px 12px;
    border-bottom: 1px solid #f0f0f0;
    font-size: 0.85rem;
    vertical-align: middle;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap; /* Keep it narrow and elegant */
}

td:hover {
    white-space: normal; /* Expand on hover if needed */
}

tr:hover td { background: #fcfcfc; }

/* Forms */
.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 20px;
}

.form-group { margin-bottom: 20px; position: relative; }
.password-toggle {
    position: absolute;
    right: 14px;
    bottom: 12px; /* Positioned relative to bottom of form-group */
    cursor: pointer;
    color: var(--text-muted);
    transition: color 0.2s;
    background: transparent;
    border: none;
    display: flex;
    align-items: center;
    padding: 0;
    z-index: 10;
}
.password-toggle:hover { color: var(--primary); }
.form-group.full-width { grid-column: 1 / -1; }

@media (min-width: 600px) {
    .form-group.span-2 { grid-column: span 2; }
    .form-group.span-3 { grid-column: span 3; }
}

label {
    display: block;
    font-size: 0.85rem;
    font-weight: 700;
    margin-bottom: 8px;
    color: var(--text-muted);
}

input, select, textarea {
    width: 100%;
    padding: 14px 16px;
    border: 1.5px solid #eee;
    border-radius: 12px;
    font-size: 1rem;
    outline: none;
    transition: all 0.2s;
    background: #fafafa;
    font-family: inherit;
}

input:focus, select:focus, textarea:focus {
    border-color: var(--primary);
    background: white;
    box-shadow: 0 0 0 4px rgba(0, 123, 255, 0.1);
}

/* Stats Cards */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 24px;
    margin-bottom: 32px;
}

.stat-card {
    background: white;
    padding: 28px;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    display: flex;
    flex-direction: column;
    align-items: center;
    border: 1px solid rgba(0,0,0,0.01);
}

.stat-value {
    font-size: 2.25rem;
    font-weight: 800;
    color: var(--primary);
    margin-bottom: 8px;
}

.stat-label {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-muted);
}

.stat-card.total {
    background: linear-gradient(135deg, #007bff, #0056b3);
}
.stat-card.total .stat-value, .stat-card.total .stat-label { color: white; }

/* Courier Panel (Mobile-First) */
.courier-view {
    max-width: 480px;
    margin: 0 auto;
}

@media (max-width: 480px) {
    .container {
        padding: 10px;
    }
}

.delivery-card {
    background: white;
    border-radius: 16px;
    padding: 16px;
    margin-bottom: 12px;
    box-shadow: var(--shadow);
    border: 1px solid rgba(0,0,0,0.02);
}

@media (max-width: 600px) {
    .delivery-card {
        padding: 12px;
        border-radius: 14px;
        margin-bottom: 8px; /* Better spacing between cards */
        box-shadow: 0 2px 6px rgba(0,0,0,0.03);
        border: 1px solid #f0f0f0;
    }
}

.delivery-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
    align-items: flex-start;
}

.customer-name { 
    font-size: 1.05rem; 
    font-weight: 800; 
    word-break: break-word;
    flex: 1;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    line-height: 1.3;
}
.drag-handle {
    cursor: grab;
    transition: color 0.2s;
}
.drag-handle:active { cursor: grabbing; color: var(--primary) !important; }

.sortable-ghost {
    opacity: 0.3;
    background: var(--primary-soft) !important;
    border: 2px dashed var(--primary) !important;
}

.info-price { 
    font-size: 1.15rem; 
    font-weight: 900; 
    color: var(--primary); 
    white-space: nowrap;
    margin-left: 8px;
}

.info-box {
    margin-top: 6px;
    background: transparent;
    border-radius: 0;
    padding: 2px 0;
    border: none;
    border-top: 1px dashed #eee;
}

.info-item {
    display: flex;
    align-items: flex-start;
    gap: 6px;
    margin-top: 4px;
    margin-bottom: 0;
    color: var(--text-muted);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.8rem;
    word-break: break-word;
}

.info-item:last-child { margin-bottom: 0; }
.info-item i { width: 14px; color: var(--primary); flex-shrink: 0; margin-top: 2px; }

.info-item.link-active:hover { color: var(--primary); }

/* Top Progress Bar */
#top-progress-bar {
    position: fixed;
    top: 0;
    left: 0;
    width: 0%;
    height: 3px;
    background: var(--primary);
    z-index: 10000;
    transition: width 0.3s ease, opacity 0.5s ease;
    box-shadow: 0 0 10px var(--primary-soft);
}

/* Initially hide app screens gently */
#login-screen, #main-content {
    opacity: 0;
    transition: opacity 0.5s ease;
}

/* Modal */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.6);
    backdrop-filter: blur(4px);
    display: none;
    align-items: flex-end;
    justify-content: center;
    z-index: 2000;
}

@media (min-width: 768px) {
    .modal-overlay { align-items: center; }
}

.modal-content {
    background: white;
    width: 100%;
    max-width: 500px;
    border-radius: 30px 30px 0 0;
    padding: 32px;
    box-shadow: 0 -10px 40px rgba(0,0,0,0.1);
}

@media (min-width: 768px) {
    .modal-content { border-radius: 24px; }
}

.payment-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
    margin: 24px 0;
}

.payment-option {
    padding: 20px;
    border: 2px solid #f0f0f0;
    border-radius: 16px;
    display: flex;
    align-items: center;
    gap: 16px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
}

.payment-option i { font-size: 1.4rem; color: var(--primary); }

.payment-option.active {
    border-color: var(--primary);
    background: var(--primary-soft);
    color: var(--primary);
}

/* Header & Sidebar (Admin) */
.header-actions {
    display: flex;
    gap: 12px;
    align-items: center;
}

/* Progress Bar Animation */
.progress-animated {
    background-image: linear-gradient(
        45deg, 
        rgba(255, 255, 255, 0.4) 25%, 
        transparent 25%, 
        transparent 50%, 
        rgba(255, 255, 255, 0.4) 50%, 
        rgba(255, 255, 255, 0.4) 75%, 
        transparent 75%, 
        transparent
    ) !important;
    background-size: 1rem 1rem !important;
    animation: progress-move 1s linear infinite;
}

@keyframes progress-move {
    0% { background-position: 1rem 0; }
    100% { background-position: 0 0; }
}

/* Date Navigation */
.date-nav {
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Courier Date Row - full width second line in nav-panel */
.courier-date-row {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding-top: 10px;
    margin-top: 10px;
    border-top: 1px solid #f0f0f0;
}

/* Mobile: courier-specific nav adjustments */
@media (max-width: 600px) {
    body.courier-mode #canli-badge {
        display: none !important;
    }
    body.courier-mode #nav-right-section {
        display: none !important;
    }
    body.courier-mode #mobile-logout-btn {
        display: inline-flex !important;
    }
    body.courier-mode #display-user-name {
        display: none !important;
    }
    body.courier-mode #courier-date-row {
        width: auto !important;
        padding-top: 0 !important;
        margin-top: 0 !important;
        border-top: none !important;
    }
}

.date-nav-btn {
    padding: 4px 8px;
    border-radius: 8px;
    border: 1px solid #eee;
    background: #fff;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    color: var(--text-muted);
}

.date-nav-btn:hover { background: #f9f9f9; color: var(--primary); border-color: var(--primary); }

.date-display {
    font-weight: 700;
    font-size: 0.85rem;
    color: var(--text-dark);
    min-width: 90px;
    text-align: center;
    cursor: pointer;
    padding: 4px 8px;
    border: 1px solid transparent;
    border-radius: 8px;
    transition: all 0.2s;
}

.date-display:hover {
    background: #f0f7ff;
    border-color: #d0e7ff;
    color: var(--primary);
}

.date-display small {
    display: block;
    font-weight: 400;
    font-size: 0.65rem;
    color: var(--text-muted);
}

.date-display small {
    display: block;
    font-weight: 400;
    font-size: 0.7rem;
    color: var(--text-muted);
}

.date-picker-mini {
    padding: 6px;
    border: 1px solid #eee;
    border-radius: 8px;
    font-family: inherit;
    font-size: 0.8rem;
    outline: none;
}

.date-picker {
    padding: 10px 16px;
    border: 1.5px solid #eee;
    border-radius: 12px;
    font-weight: 600;
}

img, input, select, textarea, div, table {
    max-width: 100%;
}

/* Modern Responsive Logic for Admin Panel - Revised */
@media (max-width: 768px) {
    /* Prevent any horizontal overflow */
    html, body {
        overflow-x: hidden;
        position: relative;
    }

    .container {
        padding: 10px !important;
        padding-bottom: 20px !important; 
    }

    /* Primary Navigation (Back to Top) */
    .nav-panel {
        margin-bottom: 10px;
        padding: 5px 10px;
        flex-direction: row !important;
        height: auto !important;
        align-items: center !important;
        justify-content: space-between !important;
        gap: 6px !important;
        flex-wrap: wrap !important; /* Allow wrapping for date second row */
    }

    .nav-panel > div:first-child {
        flex: 0 1 auto !important; /* Don't grow, let it sit on the left or middle */
        padding-left: 0 !important;
    }

    #user-avatar-container {
        width: 44px !important; /* Smaller for mobile top bar */
        height: 44px !important;
        border-width: 2px !important;
    }

    #display-user-name {
        display: none; /* Hide name to save space, focus on "Admin section" i.e. photo */
    }

    #nav-right-section {
        position: static !important;
        background: transparent !important;
        padding: 0 !important;
        display: flex !important;
        flex-wrap: wrap !important; /* Allow internal wrapping */
        margin-left: 0 !important;
        flex: 1;
        justify-content: flex-end;
        align-items: center;
        gap: 4px;
        box-shadow: none !important;
        border-top: none !important;
    }

    #nav-right-section button {
        flex: unset !important;
        flex-direction: row !important;
        gap: 8px !important;
        font-size: 0.85rem !important;
        height: 44px !important;
        padding: 0 10px !important;
        justify-content: center !important;
    }

    #nav-right-section button i {
        width: 18px !important;
        height: 18px !important;
    }

    #admin-date-nav {
        margin-left: auto !important; 
        background: #f8f9fa !important;
        padding: 4px 8px !important;
        border: 1px solid #eee !important;
        border-radius: 12px;
        width: 100% !important; /* Force to second row */
        display: flex !important;
        justify-content: flex-end !important;
        margin-top: 8px !important;
        position: relative;
        z-index: 5;
        order: 10 !important; /* Bottom row */
    }

    #admin-date-nav .date-nav-btn {
        display: flex !important; /* Bring back arrows */
        padding: 6px 8px !important;
        border: none !important;
        background: #f0f0f0 !important;
    }

    #admin-date-nav .date-display {
        font-size: 0.75rem;
        background: var(--white);
        padding: 4px 8px;
        border-radius: 6px;
        border: 1px solid #eee;
        min-width: 85px !important;
        text-align: center;
    }

    #admin-date-separator {
        display: none !important;
    }

    /* Price and Payment markers flex display */
    .admin-row-clickable td[data-label="No"] .mobile-only {
        display: flex !important;
        align-items: center;
        gap: 6px;
    }

    #desktop-logout-btn {
        display: flex !important;
        width: auto !important;
        margin-top: 0 !important;
        padding: 8px !important;
        color: var(--danger) !important;
        order: 5 !important; /* Top row, far right */
        margin-left: 4px !important;
    }

    #desktop-logout-btn i {
        margin: 0 !important;
    }

    #desktop-logout-btn span, #desktop-logout-btn {
        font-size: 0; /* Hide text, show only icon to save space */
    }
    
    #desktop-logout-btn i {
        width: 22px !important;
        height: 22px !important;
    }

    /* Adres tam görünüm kuralları */
    .admin-row-clickable td[data-label="Adres"] {
        white-space: normal !important;
        word-break: break-word !important;
        overflow: visible !important;
        text-overflow: clip !important;
        line-height: 1.4 !important;
        padding: 8px 4px !important;
    }

    /* Tablo sütunları arası mesafe daraltma */
    .admin-row-clickable td {
        padding: 8px 4px !important;
    }

    .mobile-hidden {
        display: none !important;
    }

    /* Sub-navigation Tabs */
    .sub-nav-tabs {
        flex-direction: row !important; /* Keep on one row */
        gap: 4px;
        padding: 4px !important;
        overflow-x: auto; /* Allow horizontal scroll if absolutely needed */
        justify-content: space-between;
        width: 100%;
    }

    .sub-nav-btn {
        padding: 8px 10px !important;
        font-size: 0.75rem !important; /* Smaller text to fit */
        white-space: nowrap;
        flex: 1;
        text-align: center;
    }

    .sub-nav-tabs > div {
        display: grid !important;
        grid-template-columns: 1fr 1fr;
        gap: 8px;
    }

    .sub-nav-btn {
        width: 100%;
        text-align: center;
        font-size: 0.8rem;
        padding: 10px 6px !important;
        justify-content: center;
    }

    /* --- Accordion Card Transformation --- */
    .table-container, .table-responsive {
        background: transparent;
        box-shadow: none;
        overflow: visible;
    }

    table, thead, tbody, th, td, tr {
        display: block;
        width: 100% !important;
    }

    thead tr {
        position: absolute;
        top: -9999px;
        left: -9999px;
    }

    /* Accordion Trigger Styling */
    .admin-row-clickable {
        background: white;
        border-radius: 12px;
        margin-bottom: 10px;
        box-shadow: 0 2px 6px rgba(0,0,0,0.04);
        border: 1px solid #eee;
        overflow: hidden;
        transition: box-shadow 0.2s;
    }

    /* Only show first two essential cells when collapsed */
    .admin-row-clickable td {
        display: none;
        border: none;
        padding: 12px 15px 12px 120px !important; /* Large left padding for absolute labels */
        border-bottom: 1px solid #f9f9f9;
        text-align: left;
        justify-content: flex-start;
        position: relative;
        min-height: 44px;
        word-break: break-word;
        white-space: normal !important; /* Ensure wrapping */
    }

    .admin-row-clickable td[data-label="No"],
    .admin-row-clickable td[data-label="Müşteri / Firma"] {
        display: flex !important;
        text-align: left;
        justify-content: flex-start;
    }

    .admin-row-clickable td[data-label="No"] {
        background: #fafafa;
        padding: 8px 15px !important; /* Reset padding for No cell */
        font-size: 0.85rem;
        font-weight: 800;
        color: var(--primary);
        display: flex !important;
        align-items: center;
        gap: 8px; /* For badges next to number */
        flex-wrap: wrap;
    }

    .admin-row-clickable td[data-label="Müşteri / Firma"] {
        font-weight: 700;
        font-size: 1.05rem !important;
        color: var(--text-dark);
        border-bottom: none;
        padding-left: 15px !important; /* Special case: no label, so reset padding */
    }

    /* Expanded State */
    .admin-row-clickable.expanded {
        box-shadow: 0 8px 24px rgba(0,0,0,0.1);
        border-color: var(--primary-soft);
    }

    .admin-row-clickable.expanded td {
        display: flex !important;
    }

    .admin-row-clickable.expanded td[data-label="Müşteri / Firma"] {
        border-bottom: 1px solid #eee;
        background: var(--primary-soft);
        color: var(--primary);
    }

    td:before {
        content: attr(data-label);
        position: absolute;
        left: 15px;
        text-align: left;
        font-weight: 700;
        color: #999;
        font-size: 0.7rem;
        text-transform: uppercase;
    }

    td[data-label="No"]:before,
    td[data-label="Müşteri / Firma"]:before {
        display: none; /* Hide labels for header cells */
    }

    td[data-label="İşlem"] {
        background: #fcfcfc;
        justify-content: center !important;
        padding-left: 15px !important;
        gap: 10px;
    }

    /* --- Compact Stats (Kasa) Grid --- */
    #user-stats-summary table, 
    #user-stats-summary tbody,
    #user-stats-summary tr {
        display: block !important;
    }

    #user-stats-summary tbody {
        display: flex !important;
        flex-direction: column !important; /* Vertical stack as requested */
        gap: 12px;
        padding: 5px;
    }

    #user-stats-summary tr {
        background: white;
        border: 1px solid #eee;
        border-radius: 12px;
        padding: 10px !important;
        margin-bottom: 0;
        box-shadow: 0 2px 4px rgba(0,0,0,0.03);
    }

    #user-stats-summary td {
        display: flex !important;
        justify-content: space-between;
        padding: 4px 0 !important;
        border: none;
        font-size: 0.8rem;
    }

    #user-stats-summary td:before {
        position: static;
        width: auto;
    }

    #user-stats-summary td[data-label="Kullanıcı / Kurye"] {
        border-bottom: 1px solid #f0f0f0;
        margin-bottom: 5px;
        padding-bottom: 5px !important;
        font-weight: 800;
        color: var(--primary);
    }

    #user-stats-summary td[data-label="Toplam"] {
        background: var(--primary-soft);
        margin-top: 5px;
        font-weight: 800;
        border-radius: 4px;
        padding: 4px !important;
    }

    /* Expense and Total Adjustments */
    #user-stats-summary tr[style*="background: #fff0f0"] {
        grid-column: span 2;
        background: #fff0f0 !important;
    }

    #user-stats-summary tfoot tr {
        display: flex !important;
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
        background: #f1f1f1 !important;
        border: none;
        padding: 15px !important;
        margin-top: 5px;
        border-radius: 0 0 12px 12px;
        width: 100%;
        box-sizing: border-box;
    }

    #user-stats-summary tfoot td {
        width: auto !important;
        font-size: 0.95rem;
        font-weight: 800;
        text-align: right;
        padding: 0 !important;
        border: none !important;
    }

    #user-stats-summary tfoot td[style*="background: #007bff"] {
        background: #28a745 !important; /* Total usually looks better in green or solid blue */
        padding: 8px 12px !important;
        border-radius: 10px;
        color: white;
        box-shadow: 0 4px 10px rgba(40, 167, 69, 0.2);
    }

    /* Button and Form container fixes */
    .header-actions, .card-actions {
        display: flex;
        flex-wrap: wrap;
        gap: 8px;
    }

    .btn-primary {
        max-width: 100%;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }
}

/* Font Awesome Icons via CDN usually, using placeholder symbols here */
.icon { font-style: normal; }

/* Login Screen */
.login-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--bg-gray);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: var(--z-index-login);
    padding: 20px;
    overflow-y: auto; /* Ensure mobile users can scroll if content is tall */
}

.login-content-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 60px;
    width: 100%;
    max-width: 1100px;
    margin: auto;
}

@media (max-width: 900px) {
    .login-content-wrapper {
        flex-direction: column;
        gap: 0;
        max-width: 400px;
    }
}

.login-illustration {
    display: none; /* Hidden on mobile */
    width: 100%;
    max-width: 500px;
    height: auto;
    object-fit: contain;
    animation: floating 3s ease-in-out infinite;
}

@media (min-width: 901px) {
    .login-illustration {
        display: block; /* Shown only on larger screens */
    }
}

@keyframes floating {
    0% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
    100% { transform: translateY(0); }
}

.login-card {
    background: white;
    width: 100%;
    max-width: 400px;
    padding: 40px;
    border-radius: 24px;
    box-shadow: var(--shadow);
    text-align: center;
}

.login-logo {
    width: 64px;
    height: 64px;
    background: var(--primary-soft);
    color: var(--primary);
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 24px;
}

.login-logo i { font-size: 2rem; }

/* Delivered Section in Courier */
.delivered-section {
    margin-top: 40px;
    padding-top: 20px;
    border-top: 2px dashed #ddd;
}

.delivered-card {
    background: rgba(255, 255, 255, 0.6);
    border: 1px solid #eee;
    opacity: 0.8;
}

.delivered-card .info-price { color: var(--text-muted); }
.delivered-card .btn { display: none; }

/* Tabs in Admin User Management */
.admin-tabs {
    display: flex;
    gap: 20px;
    margin-bottom: 24px;
    border-bottom: 1px solid #eee;
}

.admin-tab {
    padding: 12px 4px;
    cursor: pointer;
    font-weight: 600;
    color: var(--text-muted);
    position: relative;
    border-bottom: 2px solid transparent;
}

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

/* User List Table */
.user-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid #f8f8f8;
}

/* Inline Table Editing */
.table-input {
    width: 112px;
    padding: 4px 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 0.85rem;
    font-weight: 700;
    text-align: right;
    background: #fafafa;
}

.table-input:focus {
    border-color: var(--primary);
    background: white;
}

.table-select {
    width: 120px;
    padding: 4px 6px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 0.85rem;
    background: #fafafa;
}

.table-select:focus {
    border-color: var(--primary);
    background: white;
}
@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* Midnight Day Transition Overlay */
.midnight-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, #0f0c29, #302b63, #24243e);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 5000;
    animation: midnightFadeIn 0.6s ease;
}

.midnight-content {
    text-align: center;
    padding: 40px 32px;
    max-width: 380px;
    width: 90%;
    animation: midnightScaleIn 0.5s cubic-bezier(0.4, 0, 0.2, 1) 0.2s both;
}

.midnight-icon {
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, #ff9a56, #ff6a00);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 24px;
    box-shadow: 0 8px 32px rgba(255, 106, 0, 0.4);
    animation: midnightPulse 2s ease-in-out infinite;
}

.clickable-firm {
    color: var(--primary);
    cursor: pointer;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.2s;
}

.clickable-firm:hover {
    text-decoration: underline;
    opacity: 0.8;
}

#firm-history-tbody tr td {
    white-space: normal;
}

.midnight-title {
    color: #ffffff;
    font-size: 1.8rem;
    font-weight: 800;
    margin-bottom: 8px;
    letter-spacing: -0.5px;
}

.midnight-date {
    color: #ff9a56;
    font-size: 1.2rem;
    font-weight: 700;
    margin-bottom: 8px;
}

.midnight-sub {
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.9rem;
    margin-bottom: 32px;
}

.midnight-btn {
    background: linear-gradient(135deg, #ff9a56, #ff6a00) !important;
    border: none;
    box-shadow: 0 4px 20px rgba(255, 106, 0, 0.3);
}

@keyframes midnightFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes midnightScaleIn {
    from { opacity: 0; transform: scale(0.8) translateY(20px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}

@keyframes midnightPulse {
    0%, 100% { transform: scale(1); box-shadow: 0 8px 32px rgba(255, 106, 0, 0.4); }
    50% { transform: scale(1.05); box-shadow: 0 12px 40px rgba(255, 106, 0, 0.6); }
}

/* Sub-tab Navigation (Inside Dashboard) */
.sub-nav-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    background: #f0f0f0;
    padding: 6px;
    border-radius: 14px;
    width: fit-content;
}

.sub-nav-btn {
    padding: 8px 20px;
    border-radius: 10px;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--text-muted);
    transition: all 0.2s;
    border: none;
    background: transparent;
}

.sub-nav-btn.active {
    background: var(--white);
    color: var(--primary);
    box-shadow: 0 4px 10px rgba(0,0,0,0.05);
}

/* Tracking/Problematic Badges */
.badge-problematic { background: #fff4e5; color: #d97706; }
.badge-returned { background: #f3e8ff; color: #7e22ce; }

/* 7 Days Alert Animation */
.alert-7day {
    background: #dc3545;
    color: #fff;
    padding: 4px 10px;
    border-radius: 8px;
    font-weight: 800;
    font-size: 0.75rem;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    box-shadow: 0 4px 12px rgba(220, 53, 69, 0.3);
    animation: alert-pulse 1.5s infinite;
    text-transform: uppercase;
}

@keyframes alert-pulse {
    0% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.7; transform: scale(1.05); }
    100% { opacity: 1; transform: scale(1); }
}

.timestamp-container {
    font-size: 0.75rem;
    color: var(--text-muted);
    background: #f9f9f9;
    padding: 6px;
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.timestamp-item {
    display: flex;
    align-items: center;
    gap: 6px;
}

.timestamp-item i {
    width: 12px;
}

/* Circular Tracking Button */
.circle-btn-tracking {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #fff;
    border: 2px solid #fd7e14;
    color: #fd7e14;
    cursor: pointer;
    transition: all 0.2s;
    padding: 0;
}

.circle-btn-tracking:hover {
    background: #fd7e14;
    color: #fff;
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(253, 126, 20, 0.3);
}

/* Notes List in Table */
.notes-container {
    max-width: 250px;
    font-size: 0.75rem;
    color: #444;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.note-item {
    background: #fdf2f2;
    padding: 6px 10px;
    border-radius: 10px;
    border-left: 3px solid #ff4d4d;
    position: relative;
}

.note-time {
    font-size: 0.65rem;
    color: #999;
    font-weight: 600;
    margin-bottom: 2px;
    display: block;
}

.add-note-btn {
    background: #eef2ff;
    color: #4f46e5;
    border: 1px dashed #4f46e5;
    padding: 4px 8px;
    border-radius: 8px;
    font-size: 0.7rem;
    font-weight: 700;
    cursor: pointer;
    margin-top: 5px;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.add-note-btn:hover {
    background: #4f46e5;
    color: #fff;
}

/* Muhasebe & Rapor Tablo Stilleri */
.report-table {
    width: 100%;
    margin-top: 15px;
    border-collapse: separate;
    border-spacing: 0 8px;
}

.report-table th {
    background: #f8f9fa;
    padding: 12px;
    font-size: 0.75rem;
    color: #888;
    text-transform: uppercase;
    border-bottom: 2px solid #eee;
}

.report-table td {
    background: #fff;
    padding: 15px 12px;
    border-top: 1px solid #f0f0f0;
    border-bottom: 1px solid #f0f0f0;
    font-size: 0.9rem;
}

.report-table tr:hover td {
    background: #f9fbff;
}

.report-table td:first-child { border-left: 1px solid #f0f0f0; border-radius: 10px 0 0 10px; }
.report-table td:last-child { border-right: 1px solid #f0f0f0; border-radius: 0 10px 10px 0; }

/* Dashboard Muhasebe Kartı İyileştirmeleri */
#admin-expenses-list h3, #admin-expenses-list thead {
    display: none !important;
}

#admin-expenses-list .table-responsive {
    overflow: visible !important;
}
#dashboard-finance-section .stat-card {
    border-left: 4px solid var(--primary);
    text-align: left;
    align-items: flex-start;
    padding: 15px 20px;
}

#dashboard-finance-section .stat-value {
    font-size: 1.5rem;
    margin-bottom: 4px;
}

#dashboard-finance-section .stat-label {
    font-size: 0.75rem;
}

/* Report & Firm Tables Mobile Transformation */
@media (max-width: 768px) {
    .report-table, .report-table tbody, .report-table tr, .report-table td,
    #firm-tbody, #firm-tbody tr, #firm-tbody td {
        display: block !important;
        width: 100% !important;
    }

    .report-table thead, #firm-list-container thead {
        display: none !important;
    }

    .report-table tr, #firm-tbody tr {
        background: white;
        border-radius: 12px;
        margin-bottom: 12px;
        padding: 10px;
        box-shadow: 0 2px 6px rgba(0,0,0,0.03);
        border: 1px solid #eee;
    }

    .report-table td, #firm-tbody td {
        padding: 8px 10px 8px 85px !important; /* Back to side-by-side but with enough space */
        position: relative;
        text-align: left !important;
        border: none !important;
        min-height: 34px;
        font-size: 0.75rem !important; /* ~20% smaller puntosu */
    }

    .report-table td:before, #firm-tbody td:before {
        content: attr(data-label);
        position: absolute;
        top: 8px; 
        left: 10px;
        font-weight: 700;
        color: #999;
        font-size: 0.6rem; /* Smaller labels */
        text-transform: uppercase;
        width: 70px; /* Fixed width for labels to keep content aligned on the right */
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .report-table td:first-child, #firm-tbody td:first-child {
        border-radius: 0;
        background: #fbfbfb;
        font-weight: 800;
        padding-left: 10px !important;
    }

    .report-table td:first-child:before, #firm-tbody td:first-child:before {
        display: none;
    }

    /* Kasa Compact Adjustments */
    .kasa-title-compact {
        font-size: 0.8rem !important; /* ~20% smaller */
        font-weight: 800;
    }

    .btn-compact {
        padding: 6px 8px !important;
        font-size: 0.75rem !important;
        min-width: 65px;
    }
}

/* ==========================================
   SETTINGS MENU & HUB STYLES
   ========================================== */

.settings-menu-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
    margin-top: 10px;
    animation: fadeIn 0.4s ease;
}

.settings-menu-card {
    background: var(--white);
    border-radius: 20px;
    padding: 30px 24px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1px solid rgba(0,0,0,0.03);
    box-shadow: 0 4px 15px rgba(0,0,0,0.03);
    position: relative;
    overflow: hidden;
}

.settings-menu-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 30px rgba(0,0,0,0.08);
    border-color: var(--primary-soft);
}

.settings-menu-card:active {
    transform: scale(0.97);
}

.settings-menu-icon {
    width: 64px;
    height: 64px;
    border-radius: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 20px;
    transition: all 0.3s ease;
}

.settings-menu-card:hover .settings-menu-icon {
    transform: scale(1.1) rotate(5deg);
}

.settings-menu-title {
    font-size: 1.15rem;
    font-weight: 800;
    color: var(--text-dark);
    margin-bottom: 8px;
}

.settings-menu-desc {
    font-size: 0.85rem;
    color: var(--text-muted);
    line-height: 1.4;
    max-width: 220px;
}

.settings-view-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
    padding-bottom: 15px;
    border-bottom: 1px solid #eee;
}

.settings-back-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    border-radius: 12px;
    background: #f1f5f9;
    color: #475569;
    font-weight: 700;
    font-size: 0.85rem;
    border: none;
    cursor: pointer;
    transition: all 0.2s;
}

.settings-back-btn:hover {
    background: #e2e8f0;
    color: var(--primary);
    transform: translateX(-3px);
}

/* Specific Menu Card Colors */
.menu-card-blue .settings-menu-icon { background: #e0f2fe; color: #0369a1; }
.menu-card-green .settings-menu-icon { background: #dcfce7; color: #15803d; }
.menu-card-orange .settings-menu-icon { background: #ffedd5; color: #c2410c; }
.menu-card-purple .settings-menu-icon { background: #f3e8ff; color: #7e22ce; }
.menu-card-indigo .settings-menu-icon { background: #e0e7ff; color: #4338ca; }

@media (max-width: 600px) {
    .settings-menu-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }
    .settings-menu-card {
        padding: 20px;
        flex-direction: row;
        text-align: left;
        gap: 15px;
    }
    .settings-menu-icon {
        width: 48px;
        height: 48px;
        margin-bottom: 0;
        border-radius: 12px;
    }
    .settings-menu-title {
        font-size: 1rem;
        margin-bottom: 2px;
    }
    .settings-menu-desc {
        font-size: 0.75rem;
    }
}

/* ==========================================
   COURIER ACCOUNTING & SUB-NAV STYLES
   ========================================== */

.courier-sub-nav {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    background: #f1f5f9;
    padding: 6px;
    border-radius: 16px;
    position: sticky;
    top: 70px;
    z-index: 90;
    box-shadow: 0 4px 12px rgba(0,0,0,0.05);
}

.courier-tab-btn {
    flex: 1;
    padding: 12px 10px;
    border-radius: 12px;
    border: none;
    background: transparent;
    color: #64748b;
    font-weight: 700;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.courier-tab-btn.active {
    background: var(--white);
    color: var(--primary);
    box-shadow: 0 4px 10px rgba(0,0,0,0.08);
}

.courier-tab-btn i {
    width: 18px;
    height: 18px;
}

/* Finance & Balance Cards */
.courier-balance-card {
    background: linear-gradient(135deg, #1e293b, #334155);
    color: white;
    padding: 24px;
    border-radius: 20px;
    margin-bottom: 20px;
    text-align: center;
    box-shadow: 0 10px 25px rgba(30, 41, 59, 0.2);
}

.balance-label {
    font-size: 0.8rem;
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 8px;
}

.balance-value {
    font-size: 2rem;
    font-weight: 800;
}

.balance-value.positive { color: #4ade80; }
.balance-value.negative { color: #f87171; }

/* Week Selector */
.week-selector-scroll {
    display: flex;
    overflow-x: auto;
    gap: 10px;
    padding-bottom: 5px;
    margin-bottom: 20px;
    -ms-overflow-style: none;
    scrollbar-width: none;
}

.week-selector-scroll::-webkit-scrollbar { display: none; }

.week-btn {
    background: var(--white);
    border: 1.5px solid #e2e8f0;
    padding: 10px 16px;
    border-radius: 14px;
    white-space: nowrap;
    font-size: 0.85rem;
    font-weight: 700;
    color: #64748b;
    cursor: pointer;
    transition: all 0.2s;
}

.week-btn.active {
    background: var(--primary);
    border-color: var(--primary);
    color: white;
    box-shadow: 0 4px 12px rgba(255, 106, 0, 0.3);
}

/* Transaction List */
.finance-item {
    background: var(--white);
    border-radius: 16px;
    padding: 16px;
    margin-bottom: 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border: 1px solid rgba(0,0,0,0.03);
    box-shadow: 0 2px 8px rgba(0,0,0,0.02);
}

.finance-item-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.finance-item-icon {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.icon-in { background: #dcfce7; color: #16a34a; }
.icon-out { background: #fee2e2; color: #dc2626; }

.finance-item-info {
    display: flex;
    flex-direction: column;
}

.finance-item-title {
    font-weight: 700;
    font-size: 0.9rem;
    color: var(--text-dark);
}

.finance-item-date {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.finance-item-amount {
    font-weight: 800;
    font-size: 1rem;
}

.amount-plus { color: #16a34a; }
.amount-minus { color: #dc2626; }

/* ==========================================
   B2B CALCULATION SIMULATOR STYLES
=========================================== */
.b2b-container {
    background-color: #fff;
    padding: 24px !important;
}

.b2b-input-group {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-start;
    gap: 20px;
    margin-bottom: 25px;
    background: #f0f7ff;
    padding: 20px;
    border-radius: 16px;
    border: 1px solid #d0e7ff;
}

.b2b-input-box {
    flex: 1;
    min-width: 200px;
    display: flex;
    flex-direction: column;
}

.b2b-input-box label {
    color: var(--primary);
    font-weight: 800;
}

.b2b-tiers-group {
    background: #f8fafc;
    padding: 20px;
    border-radius: 16px;
    margin-bottom: 20px;
    border: 1px solid #e2e8f0;
}

.b2b-tiers-group h3 {
    margin-top: 0;
    font-size: 0.85rem;
    color: #475569;
    margin-bottom: 15px;
    text-transform: uppercase;
    letter-spacing: 1px;
    border-bottom: 1px solid #e2e8f0;
    padding-bottom: 8px;
    font-weight: 800;
}

.b2b-tiers-row {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-start;
    gap: 12px;
}

.b2b-tier-box {
    flex: 1;
    min-width: 90px;
    display: flex;
    flex-direction: column;
    text-align: center;
    background: #fff;
    padding: 10px;
    border-radius: 12px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.03);
    border: 1px solid #f1f5f9;
}

.b2b-tier-box label {
    font-size: 0.7rem;
    margin-bottom: 6px;
    font-weight: 800;
    color: #64748b;
}

.b2b-tier-box.iskonto label { color: #3b82f6; }
.b2b-tier-box.kargo-mus label { color: #10b981; }
.b2b-tier-box.kargo-sen label { color: #ef4444; }

.b2b-tier-box.carpan { min-width: 320px; border-left: 4px solid #8b5cf6; }
.b2b-tier-box.carpan label { color: #8b5cf6; font-size: 0.8rem; }

.b2b-tier-box input {
    padding: 8px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    font-size: 1rem;
    text-align: center;
    font-weight: 800;
    width: 100%;
    color: var(--text-dark);
}

.carpan-inputs {
    display: flex;
    gap: 8px;
    align-items: center;
    justify-content: center;
}

.carpan-inputs span {
    font-weight: 800;
    color: #94a3b8;
}

.b2b-summary-group {
    display: flex;
    gap: 20px;
    margin-bottom: 25px;
}

.b2b-summary-card {
    flex: 1;
    background: #1e293b;
    color: #fff;
    padding: 20px;
    border-radius: 16px;
    text-align: center;
    box-shadow: 0 10px 25px rgba(0,0,0,0.1);
}

.b2b-summary-card span {
    display: block;
    font-size: 1.8rem;
    font-weight: 900;
    margin-top: 8px;
    color: #fbbf24;
}

.b2b-table th {
    background-color: var(--primary);
    color: white;
}

.danger-row {
    background-color: #fff1f2 !important;
}

.badge-uygun {
    background: #22c55e;
    color: white;
    padding: 4px 10px;
    border-radius: 6px;
    font-weight: 800;
    display: inline-block;
}

.badge-ihlal {
    background: #ef4444;
    color: white;
    padding: 4px 10px;
    border-radius: 6px;
    font-weight: 800;
    display: inline-block;
}

.barem-group { background: #f5f3ff; border-color: #ddd6fe; }
.cargo-group { background: #fff7ed; border-color: #ffedd5; }

.text-purple { color: #8b5cf6 !important; }

@media (max-width: 768px) {
    .b2b-summary-group { flex-direction: column; }
    .b2b-tier-box.carpan { min-width: 100%; }
    .b2b-table td { font-size: 0.75rem; }
}

.b2b-table td {
    white-space: normal; /* Allow text wrap for small screens */
}

/* Collapsible Section Headers */
.b2b-collapsible-header {
    background-color: #f1f5f9;
    padding: 12px 20px;
    border-radius: 12px;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    transition: background-color 0.2s;
    user-select: none;
    border: 1px solid #e2e8f0;
}

.b2b-collapsible-header:hover {
    background-color: #e2e8f0;
}

.b2b-collapsible-header h3 {
    margin: 0 !important;
    padding: 0 !important;
    border: none !important;
    font-size: 0.9rem !important;
    color: #475569 !important;
    font-weight: 800 !important;
    text-transform: uppercase;
}

.b2b-toggle-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    background: #fff;
    border-radius: 50%;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    color: var(--primary);
    transition: transform 0.2s;
}

.b2b-collapsible-content {
    overflow: hidden;
    transition: max-height 0.3s ease-out;
}

.b2b-barem-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 10px;
}

.b2b-barem-row {
    display: flex;
    align-items: center;
    gap: 10px;
    background: #fff;
    padding: 8px 12px;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
}

.b2b-barem-row .barem-label {
    font-size: 0.75rem;
    font-weight: 600;
    color: #64748b;
    min-width: 60px;
}

.b2b-barem-row input {
    width: 80px !important;
    padding: 6px 8px !important;
    font-size: 0.8rem !important;
    border: 1px solid #cbd5e1 !important;
    border-radius: 4px !important;
}

.b2b-barem-row .barem-mult {
    color: #7e22ce;
    font-weight: 800;
    width: 65px !important;
}

.b2b-btn-add {
    background: #e0e7ff;
    color: #4338ca;
    border: none;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 5px;
    margin-bottom: 15px;
    transition: all 0.2s;
}

.b2b-btn-add:hover {
    background: #c7d2fe;
}

.b2b-btn-remove {
    background: #fee2e2;
    color: #dc2626;
    border: none;
    width: 24px;
    height: 24px;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
}

.b2b-btn-remove:hover {
    background: #fecaca;
}

.b2b-container .b2b-tiers-group {
    margin-top: 5px;
}

/* Supplier Manager Copy Box */
.copy-box {
    display: inline-flex;
    align-items: center;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 6px;
    transition: all 0.2s;
    border: 1px solid transparent;
}

.copy-box:hover {
    background: #f0f7ff;
    border-color: #d0e7ff;
    color: var(--primary);
}

.copy-box:active {
    transform: scale(0.95);
    background: #e1efff;
}

/* Supplier Logo Circle */
.supplier-logo-circle {
    width: 48px;
    height: 48px;
    min-width: 48px;
    border-radius: 50%;
    background: white;
    border: 1px solid #f0f0f0;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}

.supplier-logo-circle img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}
