/* MD E-Fatura - Modern Admin Stylesheet */

:root {
    /* Colors */
    --primary: #4f46e5;
    --primary-hover: #4338ca;
    --primary-light: #eef2ff;

    --success: #10b981;
    --success-light: #ecfdf5;

    --warning: #f59e0b;
    --warning-light: #fffbeb;

    --danger: #ef4444;
    --danger-light: #fef2f2;

    --slate-50: #f8fafc;
    --slate-100: #f1f5f9;
    --slate-200: #e2e8f0;
    --slate-300: #cbd5e1;
    --slate-400: #94a3b8;
    --slate-500: #64748b;
    --slate-600: #475569;
    --slate-700: #334155;
    --slate-800: #1e293b;
    --slate-900: #0f172a;

    --bg-main: var(--slate-50);
    --bg-surface: #ffffff;
    --text-main: var(--slate-800);
    --text-muted: var(--slate-500);
    --border-color: var(--slate-200);

    /* Shadows */
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
    --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);

    /* Layout */
    --sidebar-width: 260px;
    --header-height: 70px;
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 16px;

    /* Transitions */
    --transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--bg-main);
    color: var(--text-main);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

/* iOS'un inputlara odaklanınca otomatik yakınlaşmasını engellemek için */
@media screen and (max-width: 768px) {

    input,
    select,
    textarea {
        font-size: 16px !important;
    }

    /* Mobil cihazlarda tabloların    /* Data table mobile sizing */
    .data-table {
        font-size: 13px;
        width: 100% !important;
    }
}

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

/* Layout Structure */
.admin-layout {
    display: flex;
    min-height: 100vh;
}

/* Sidebar */
.sidebar {
    width: var(--sidebar-width);
    background: var(--slate-900);
    color: white;
    height: 100vh;
    position: fixed;
    left: 0;
    top: 0;
    display: flex;
    flex-direction: column;
    z-index: 100;
    transition: var(--transition);
}

.sidebar-header {
    padding: 24px;
    display: flex;
    align-items: center;
    gap: 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.sidebar-header .logo-text {
    font-size: 20px;
    font-weight: 700;
    letter-spacing: -0.5px;
    color: white;
}

.sidebar-nav {
    flex: 1;
    padding: 20px 12px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 16px;
    border-radius: var(--radius-sm);
    color: var(--slate-400);
    font-size: 14px;
    font-weight: 500;
}

.nav-item:hover {
    background: rgba(255, 255, 255, 0.05);
    color: white;
}

.nav-item.active {
    background: var(--primary);
    color: white;
    box-shadow: 0 4px 12px rgba(79, 70, 229, 0.3);
}

.nav-item i {
    width: 20px;
    height: 20px;
}

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

/* Top Bar */
.top-bar {
    height: var(--header-height);
    background: var(--bg-surface);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    position: sticky;
    top: 0;
    z-index: 90;
    backdrop-filter: blur(8px);
    background: rgba(255, 255, 255, 0.85);
}

.page-title h1 {
    font-size: 20px;
    font-weight: 600;
    color: var(--slate-800);
}

.top-bar-right {
    display: flex;
    align-items: center;
    gap: 20px;
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 6px 12px;
    border-radius: 50px;
    background: var(--slate-100);
}

.user-avatar {
    width: 32px;
    height: 32px;
    background: var(--primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 600;
    font-size: 14px;
}

/* Page Container */
.content-container {
    padding: 20px 24px;
    max-width: none;
    width: 100%;
}

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

.stat-card {
    background: var(--bg-surface);
    padding: 24px;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    gap: 12px;
    transition: var(--transition);
}

.stat-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.stat-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.stat-icon-wrapper {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-md);
    background: var(--primary-light);
    color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
}

.stat-value {
    font-size: 28px;
    font-weight: 700;
    color: var(--slate-900);
    letter-spacing: -1px;
}

.stat-label {
    font-size: 14px;
    font-weight: 500;
    color: var(--slate-500);
}

/* Cards & Sections */
.card {
    background: var(--bg-surface);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
    overflow: hidden;
    margin-bottom: 24px;
}

.card-header {
    padding: 16px 24px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.card-header h2 {
    font-size: 18px;
    font-weight: 600;
}

.card-body {
    padding: 24px;
}

/* Tables */
.table-responsive {
    overflow-x: auto;
    width: 100%;
    -webkit-overflow-scrolling: touch;
}

.data-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
}

.data-table th {
    background: var(--slate-50);
    padding: 12px 16px;
    text-align: left;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--slate-500);
    border-bottom: 1px solid var(--border-color);
}

.data-table td {
    padding: 8px 12px;
    border-bottom: 1px solid var(--border-color);
    font-size: 14px;
    color: var(--slate-700);
}

.data-table tr:last-child td {
    border-bottom: none;
}

.data-table tr:hover td {
    background: var(--slate-50);
}

/* Badges */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 12px;
    border-radius: 50px;
    font-size: 12px;
    font-weight: 600;
}

.badge-gonderildi,
.badge-onaylandi {
    background: var(--success-light);
    color: var(--success);
}

.badge-taslak {
    background: var(--warning-light);
    color: var(--warning);
}

.badge-hata {
    background: var(--danger-light);
    color: var(--danger);
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 20px;
    border-radius: var(--radius-md);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    border: 1px solid transparent;
    transition: var(--transition);
}

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

.btn-primary:hover {
    background: var(--primary-hover);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(79, 70, 229, 0.4);
}

.btn-secondary {
    background: white;
    border-color: var(--border-color);
    color: var(--slate-700);
}

.btn-secondary:hover {
    background: var(--slate-50);
}

.btn-danger {
    background: var(--danger-light);
    color: var(--danger);
}

/* Forms */
.form-group {
    margin-bottom: 24px;
}

.form-group label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: var(--slate-700);
    margin-bottom: 8px;
}

.form-control {
    width: 100%;
    padding: 12px 16px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
    background: white;
    font-size: 15px;
    transition: var(--transition);
}

.form-control:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 4px var(--primary-light);
}

.form-control-sm {
    padding: 6px 12px !important;
    font-size: 13px !important;
    line-height: 1.4 !important;
    height: 38px !important;
    box-sizing: border-box !important;
}

select.form-control,
select.form-control-sm,
select {
    padding-top: 6px !important;
    padding-bottom: 6px !important;
    padding-left: 12px !important;
    padding-right: 28px !important;
    line-height: 1.4 !important;
    height: 38px !important;
    box-sizing: border-box !important;
    vertical-align: middle !important;
    font-size: 13px !important;
}

.table-input {
    padding: 8px 10px !important;
    font-size: 13px !important;
    border-radius: 6px !important;
}

.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 24px;
}

/* Alerts & Notices */
.alert {
    padding: 16px 24px;
    border-radius: var(--radius-md);
    margin-bottom: 24px;
    display: flex;
    align-items: center;
    gap: 12px;
    font-weight: 500;
}

.alert-success {
    background: var(--success-light);
    color: var(--success);
    border: 1px solid #10b98120;
}

.alert-error {
    background: var(--danger-light);
    color: var(--danger);
    border: 1px solid #ef444420;
}

/* Floating Toast Notification System (Zero Layout Shift) */
#toast-notification-container {
    position: fixed !important;
    top: 24px !important;
    right: 24px !important;
    z-index: 999999 !important;
    display: flex !important;
    flex-direction: column !important;
    gap: 10px !important;
    pointer-events: none !important;
    max-width: 420px !important;
    width: calc(100% - 48px) !important;
}

.toast-notification-item {
    pointer-events: auto !important;
    background: #ffffff !important;
    color: var(--slate-800) !important;
    border-radius: 12px !important;
    padding: 14px 18px !important;
    box-shadow: 0 12px 30px -5px rgba(0, 0, 0, 0.18), 0 0 0 1px rgba(0, 0, 0, 0.05) !important;
    display: flex !important;
    align-items: center !important;
    gap: 12px !important;
    font-size: 14px !important;
    font-weight: 500 !important;
    line-height: 1.4 !important;
    animation: toastSlideIn 0.35s cubic-bezier(0.16, 1, 0.3, 1) !important;
    transition: opacity 0.3s ease, transform 0.3s ease !important;
}

.toast-notification-item.toast-success {
    border-left: 4px solid #10b981 !important;
    background: #f0fdf4 !important;
    color: #166534 !important;
}

.toast-notification-item.toast-error,
.toast-notification-item.toast-danger {
    border-left: 4px solid #ef4444 !important;
    background: #fef2f2 !important;
    color: #991b1b !important;
}

.toast-notification-item.toast-warning {
    border-left: 4px solid #f59e0b !important;
    background: #fffbeb !important;
    color: #92400e !important;
}

.toast-notification-item.toast-info {
    border-left: 4px solid #0ea5e9 !important;
    background: #f0f9ff !important;
    color: #075985 !important;
}

@keyframes toastSlideIn {
    from { opacity: 0; transform: translateY(-16px) scale(0.95); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

/* Floating Bottom Action Dock (Zero Layout Shift) */
.floating-bottom-dock {
    position: fixed !important;
    bottom: 28px !important;
    left: 50% !important;
    transform: translateX(-50%) !important;
    z-index: 99999 !important;
    background: rgba(15, 23, 42, 0.95) !important;
    backdrop-filter: blur(16px) !important;
    -webkit-backdrop-filter: blur(16px) !important;
    border: 1px solid rgba(255, 255, 255, 0.18) !important;
    box-shadow: 0 20px 40px -5px rgba(0, 0, 0, 0.4), 0 0 0 1px rgba(255, 255, 255, 0.05) !important;
    border-radius: 50px !important;
    padding: 10px 24px !important;
    color: #ffffff !important;
    display: flex !important;
    align-items: center !important;
    gap: 16px !important;
    margin: 0 !important;
    width: auto !important;
    min-width: 340px !important;
    justify-content: space-between !important;
    animation: dockFloatIn 0.3s cubic-bezier(0.16, 1, 0.3, 1) !important;
}

@keyframes dockFloatIn {
    from { opacity: 0; transform: translate(-50%, 20px) scale(0.95); }
    to { opacity: 1; transform: translate(-50%, 0) scale(1); }
}

/* Utilities */
.mobile-only {
    display: none !important;
}

.desktop-only {
    display: block !important;
}

.sidebar-footer {
    display: none !important;
}

@media (max-width: 1024px) {
    .desktop-only {
        display: none !important;
    }
}

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

    .sidebar.open {
        transform: translateX(0);
        box-shadow: 0 0 50px rgba(0, 0, 0, 0.5);
    }

    .mobile-only {
        display: inline-flex !important;
    }

    .sidebar-footer {
        display: flex !important;
        padding: 16px;
        margin-top: auto;
        border-top: 1px solid rgba(255, 255, 255, 0.1);
        flex-direction: column;
        gap: 8px;
        background: var(--slate-900);
    }

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

@media (max-width: 640px) {
    .content-container {
        padding: 20px;
    }

    .top-bar {
        padding: 0 16px;
    }

    .stat-card {
        padding: 20px;
    }
}

/* Invoice Page Specific Layouts */
.invoice-top-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 32px;
    margin-bottom: 32px;
}

.invoice-section {
    margin-bottom: 32px;
}

@media (max-width: 991px) {
    .invoice-top-grid {
        grid-template-columns: 1fr !important;
        gap: 20px;
    }
}

.invoice-bottom-actions {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    gap: 32px;
    margin-top: 32px;
    padding-top: 32px;
    border-top: 1px solid var(--border-color);
}

@media (max-width: 991px) {
    .invoice-bottom-actions {
        flex-direction: column;
        align-items: stretch;
        gap: 20px;
    }
}

@media (max-width: 1024px) {
    .invoice-bottom-container {
        max-width: none !important;
    }
}

/* Mobile Responsive Table (Card View) */
@media (max-width: 768px) {
    .data-table thead {
        display: none;
    }

    .data-table tbody tr {
        display: block;
        width: 100%;
        margin-bottom: 16px;
        background: white;
        border: 1px solid var(--border-color);
        border-radius: var(--radius-md);
        box-shadow: var(--shadow-sm);
        padding: 16px;
        box-sizing: border-box;
        /* Ensure padding doesn't add to width */
    }

    .data-table td {
        display: flex;
        align-items: flex-start;
        /* Align top for multiline content */
        justify-content: space-between;
        padding: 8px 0;
        border-bottom: 1px solid var(--slate-100);
        text-align: right;
        font-size: 14px;
        word-break: break-all;
        /* Break long words/UUIDs to prevent overflow */
        gap: 12px;
    }

    .data-table td::before {
        content: attr(data-label);
        font-weight: 600;
        color: var(--slate-500);
        text-align: left;
        width: 100px;
        flex-shrink: 0;
        /* Label shouldn't shrink below min-width */
        word-break: normal;
        /* Label text shouldn't break */
    }

    /* Content wrapper to ensure alignment */
    .data-table td>*:not(:first-child) {
        /* Ideally target direct text or wrappers, but structure varies. 
           This targets elements after the pseudo-element (simulated).
           Actually pseudo-element is child of td but not in DOM tree for selector.
           So just rely on flex behavior.
        */
        flex: 1;
        text-align: right;
        min-width: 0;
        /* Allow flex item to shrink below content size */
    }

    .data-table td:last-child {
        border-bottom: none;
        padding-top: 16px;
        flex-direction: column;
        align-items: center;
        gap: 8px;
    }

    .data-table td:last-child::before {
        text-align: center;
        width: 100%;
        margin-bottom: 4px;
    }

    /* Reset button container for stacked layout */
    .data-table td:last-child>div {
        display: flex !important;
        flex-wrap: wrap !important;
        justify-content: center;
        gap: 4px;
        width: 100%;
        overflow-x: visible !important;
    }

    /* Ensure divs inside td (like UUID stacks) break correctly */
    .data-table td div {
        word-break: break-all;
    }

    /* Hide label for checkbox / actions if not needed or handle specifically */
    .data-table td:has(input[type="checkbox"])::before {
        display: none;
    }

    .data-table td:first-child {
        border-bottom: 1px solid var(--slate-100);
        padding-bottom: 12px;
        margin-bottom: 4px;
        justify-content: center;
        /* Center checkbox */
    }

    /* Input checkbox fix for mobile */
    .data-table td:first-child input {
        display: inline-block;
    }



    .sidebar-footer .nav-item {
        background: rgba(255, 255, 255, 0.03);
        border: 1px solid rgba(255, 255, 255, 0.05);
        border-radius: var(--radius-md);
        margin-bottom: 0;
        color: var(--slate-300);
    }

    .sidebar-footer .nav-item:hover {
        background: rgba(255, 255, 255, 0.08);
        color: white;
    }

    .sidebar-footer .nav-item.logout {
        color: #ff4d4d;
        background: rgba(255, 77, 77, 0.1);
        border-color: rgba(255, 77, 77, 0.2);
    }

    /* Fluid button sizes on mobile using clamp */
    .data-table td:last-child .btn {
        padding: clamp(8px, 1.5vw, 12px) clamp(10px, 2.5vw, 16px);
        font-size: clamp(12px, 1.2vw, 14px);
        gap: 4px;
    }

    .data-table td:last-child .btn i {
        width: clamp(14px, 1.8vw, 19px);
        height: clamp(14px, 1.8vw, 19px);
    }

    /* Settings/Details Table Specifics for Mobile */
    .data-table td:first-child input {
        display: inline-block;
    }

    /* Settings/Details Table Specifics for Mobile */
    .settings-table td {
        width: 100% !important;
        text-align: left;
        justify-content: flex-start;
        border-bottom: none;
        display: block;
        /* Fallback */
    }

    .settings-table td:first-child {
        color: var(--slate-500);
        padding-bottom: 4px;
        font-size: 13px;
        text-transform: uppercase;
        letter-spacing: 0.5px;
    }

    .settings-table td:last-child {
        padding-top: 0;
        padding-bottom: 16px;
        font-size: 16px;
        font-weight: 500;
        border-bottom: 1px solid var(--slate-100);
    }

    .settings-table tr:last-child td:last-child {
        border-bottom: none;
    }

    /* Fix for Bulk Save Button Wrapping */
    #btn-bulk-save {
        white-space: nowrap;
    }

    /* Better Card Header on Mobile */
    .card-header {
        flex-wrap: wrap;
        gap: 12px;
    }

    /* Ensure the right-side actions in card header wrap correctly */
    .card-header>div:last-child {
        flex-wrap: wrap;
    }

    /* Batch Actions Mobile Layout (Sticky Bottom on Selection) */
    .batch-actions.show-fixed-bottom {
        position: fixed;
        bottom: 0;
        left: 0;
        width: 100%;
        background: white;
        padding: 12px 16px;
        box-shadow: 0 -4px 12px rgba(0, 0, 0, 0.1);
        z-index: 9999;
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 12px;
        border-top: 1px solid var(--border-color);
        animation: slideUp 0.3s ease-out;
    }

    /* Hide total count in sticky mode to save space/confusion */
    .batch-actions.show-fixed-bottom span {
        display: none !important;
    }

    .batch-actions.show-fixed-bottom button {
        margin: 0;
        width: 100%;
        justify-content: center;
        height: 44px;
        /* Touchable area */
    }

    /* Single action button full width */
    .batch-actions.show-fixed-bottom.single-action {
        grid-template-columns: 1fr;
    }

    @keyframes slideUp {
        from {
            transform: translateY(100%);
        }

        to {
            transform: translateY(0);
        }
    }
}

/* Default Desktop Styles for Batch Actions */
.batch-actions {
    display: flex;
    gap: 12px;
    align-items: center;
}

/* Dropdown Menu (Desktop) */
.user-dropdown-container {
    position: relative;
    cursor: pointer;
    /* Ensure a slightly larger hit area */
    padding: 10px 0;
    margin: -10px 0;
}

.dropdown-menu {
    position: absolute;
    top: 100%;
    right: 0;
    width: 200px;
    background: white;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-md);
    padding: 8px 0;
    margin-top: 5px;
    z-index: 1000;

    /* Smooth transition with delay to prevent jumping */
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: opacity 0.2s ease, transform 0.2s ease, visibility 0s linear 0.2s;
}

.user-dropdown-container:hover .dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
    transition-delay: 0s;
}

/* Hover bridge pseudo-element */
.dropdown-menu::before {
    content: '';
    position: absolute;
    top: -15px;
    left: 0;
    right: 0;
    height: 15px;
    background: transparent;
}

.dropdown-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 16px;
    color: var(--slate-700);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: var(--transition);
}

.dropdown-item:hover {
    background: var(--slate-50);
    color: var(--primary);
}

.dropdown-item i {
    width: 18px;
    height: 18px;
    color: var(--slate-400);
}

.dropdown-item:hover i {
    color: var(--primary);
}

.dropdown-item.logout {
    color: var(--danger);
    border-top: 1px solid var(--slate-100);
    margin-top: 4px;
    padding-top: 12px;
}

.dropdown-item.logout i {
    color: var(--danger);
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Hide desktop elements on mobile */
@media (max-width: 1024px) {
    .dropdown-menu {
        display: none !important;
    }
}

/* Sidebar structure update for sticky footer */
.sidebar {
    display: flex;
    flex-direction: column;
}

.sidebar-nav {
    flex: 1;
    overflow-y: auto;
}


/* Dashboard Overhaul Styles */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    gap: 24px;
    margin-bottom: 24px;
}

.dashboard-col-8 {
    grid-column: span 8;
}

.dashboard-col-4 {
    grid-column: span 4;
}

.dashboard-col-12 {
    grid-column: span 12;
}

@media (max-width: 1200px) {

    .dashboard-col-8,
    .dashboard-col-4 {
        grid-column: span 12;
    }
}

/* Enhanced Stat Cards */
.stat-card {
    position: relative;
    overflow: hidden;
}

.stat-card::after {
    content: '';
    position: absolute;
    top: -20px;
    right: -20px;
    width: 100px;
    height: 100px;
    background: var(--primary);
    opacity: 0.03;
    border-radius: 50%;
}

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

.trend-up {
    color: var(--success);
}

.trend-down {
    color: var(--danger);
}

/* Quick Actions Widget */
.quick-actions-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
}

.quick-action-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 20px 12px;
    background: var(--slate-50);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--slate-700);
    transition: var(--transition);
    text-align: center;
}

.quick-action-btn:hover {
    background: var(--primary-light);
    border-color: var(--primary);
    color: var(--primary);
    transform: translateY(-4px);
}

.quick-action-btn i {
    width: 32px;
    height: 32px;
}

/* Chart Container */
.chart-container {
    position: relative;
    height: 300px;
    width: 100%;
}

/* Connection Stats */
.connection-stats {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.connection-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px;
    border-radius: var(--radius-sm);
    background: var(--slate-50);
}

.connection-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.connection-info i {
    width: 20px;
    height: 20px;
    color: var(--slate-400);
}

.connection-status {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--slate-300);
}

.status-online {
    background: var(--success);
    box-shadow: 0 0 8px var(--success);
}

.status-offline {
    background: var(--danger);
}

/* Desktop Specific Fixes */
@media (min-width: 769px) {
    .data-table th:last-child {
        text-align: center;
        /* Center "İşlemler" header */
    }

    .data-table td:last-child>div {
        justify-content: flex-end;
        /* Right align buttons */
    }
}

/* ========================================
   MOBILE BOTTOM NAVIGATION BAR
   ======================================== */

/* Hide by default (desktop) */
.mobile-bottom-nav,
.mobile-menu-overlay {
    display: none;
}

/* Mobile only (< 768px) */
@media (max-width: 767px) {

    /* Hide footer on mobile */
    .admin-footer {
        display: none;
    }

    /* Add padding to main content to prevent overlap with bottom nav */
    .content-container {
        padding-bottom: 80px !important;
    }

    /* Bottom Navigation Bar (Ultra Premium Glassmorphic) */
    .mobile-bottom-nav {
        display: grid;
        grid-template-columns: 1fr 1fr 1.2fr 1fr 1fr;
        position: fixed;
        bottom: 10px;
        left: 10px;
        right: 10px;
        height: 64px;
        background: rgba(15, 23, 42, 0.94);
        backdrop-filter: blur(20px);
        -webkit-backdrop-filter: blur(20px);
        box-shadow: 0 16px 36px rgba(0, 0, 0, 0.4), 0 0 0 1px rgba(255, 255, 255, 0.12);
        border-radius: 26px;
        padding: 4px 8px;
        z-index: 99998;
        align-items: center;
    }

    /* Navigation Items */
    .mobile-bottom-nav .nav-item {
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 3px;
        text-decoration: none;
        color: #94a3b8;
        font-size: 11px;
        font-weight: 500;
        transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
        background: none;
        border: none;
        cursor: pointer;
        padding: 6px 0;
        position: relative;
    }

    .mobile-bottom-nav .nav-item i {
        width: 22px;
        height: 22px;
        stroke-width: 2;
        transition: transform 0.2s ease, color 0.2s ease;
    }

    .mobile-bottom-nav .nav-item span {
        font-size: 10px;
        font-weight: 600;
        letter-spacing: -0.2px;
    }

    /* Active State */
    .mobile-bottom-nav .nav-item.active {
        color: #38bdf8;
    }

    .mobile-bottom-nav .nav-item.active i {
        transform: translateY(-2px) scale(1.1);
        color: #38bdf8;
    }

    .mobile-bottom-nav .nav-item.active::after {
        content: '';
        position: absolute;
        bottom: 2px;
        width: 14px;
        height: 3px;
        background: #38bdf8;
        border-radius: 4px;
        box-shadow: 0 0 10px #38bdf8;
    }

    /* Center Button (Floating FAB) */
    .mobile-bottom-nav .nav-item-center {
        position: relative;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
    }

    .mobile-bottom-nav .nav-item-center .center-button {
        width: 52px;
        height: 52px;
        background: linear-gradient(135deg, #2563eb 0%, #4f46e5 100%);
        border-radius: 50%;
        display: flex;
        align-items: center;
        justify-content: center;
        box-shadow: 0 8px 24px rgba(37, 99, 235, 0.45), 0 0 0 4px rgba(15, 23, 42, 0.94);
        transform: translateY(-14px);
        transition: all 0.25s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    }

    .mobile-bottom-nav .nav-item-center .center-button i {
        width: 26px;
        height: 26px;
        color: #ffffff;
        stroke-width: 2.5;
    }

    .mobile-bottom-nav .nav-item-center:active .center-button {
        transform: translateY(-10px) scale(0.92);
        box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
    }

    .mobile-bottom-nav .nav-item-center span {
        color: #60a5fa;
        font-weight: 700;
        margin-top: -10px;
    }

    /* Full-Screen Sheet Menu Overlay */
    .mobile-menu-overlay {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(15, 23, 42, 0.7);
        backdrop-filter: blur(12px);
        -webkit-backdrop-filter: blur(12px);
        z-index: 999999;
        opacity: 0;
        visibility: hidden;
        transition: opacity 0.3s ease, visibility 0.3s ease;
        display: flex;
        align-items: flex-end;
    }

    .mobile-menu-overlay.active {
        opacity: 1;
        visibility: visible;
    }

    /* Menu Sheet Content */
    .menu-overlay-content {
        position: relative;
        width: 100%;
        max-height: 85vh;
        background: #0f172a;
        border-top-left-radius: 28px;
        border-top-right-radius: 28px;
        padding: 12px 20px 32px 20px;
        box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(255, 255, 255, 0.1);
        transform: translateY(100%);
        transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
        overflow-y: auto;
    }

    .mobile-menu-overlay.active .menu-overlay-content {
        transform: translateY(0);
    }

    .menu-sheet-handle {
        width: 40px;
        height: 5px;
        background: rgba(255, 255, 255, 0.2);
        border-radius: 10px;
        margin: 0 auto 16px auto;
    }

    /* Menu Header */
    .menu-header {
        display: flex;
        justify-content: space-between;
        align-items: center;
        margin-bottom: 20px;
        padding-bottom: 14px;
        border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    }

    .menu-close-btn {
        width: 36px;
        height: 36px;
        border-radius: 50%;
        background: rgba(255, 255, 255, 0.08);
        border: 1px solid rgba(255, 255, 255, 0.12);
        display: flex;
        align-items: center;
        justify-content: center;
        cursor: pointer;
        transition: all 0.2s ease;
        color: #94a3b8;
    }

    .menu-close-btn:active {
        background: rgba(255, 255, 255, 0.18);
        color: #ffffff;
        transform: scale(0.95);
    }

    .menu-close-btn i {
        width: 20px;
        height: 20px;
    }

    /* Menu Grid Items */
    .menu-grid {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }

    .menu-grid-item {
        display: flex;
        align-items: center;
        gap: 12px;
        padding: 14px 16px;
        background: rgba(30, 41, 59, 0.7);
        border: 1px solid rgba(255, 255, 255, 0.06);
        border-radius: 16px;
        text-decoration: none;
        color: #e2e8f0;
        font-size: 14px;
        font-weight: 600;
        transition: all 0.2s ease;
    }

    .menu-grid-item:active,
    .menu-grid-item.active {
        background: rgba(59, 130, 246, 0.15);
        border-color: rgba(59, 130, 246, 0.3);
        color: #60a5fa;
    }

    .menu-icon-box {
        width: 38px;
        height: 38px;
        border-radius: 12px;
        display: flex;
        align-items: center;
        justify-content: center;
        flex-shrink: 0;
    }

    .menu-icon-box i {
        width: 20px;
        height: 20px;
    }
}

/* Mobile Floating Bottom Dock Adjustments */
@media (max-width: 768px) {
    #main-batch-actions-bar,
    #invoice-batch-actions-bar,
    #gib-batch-actions-bar,
    #received-batch-actions-bar,
    .floating-bottom-dock {
        position: fixed !important;
        bottom: 86px !important;
        left: 12px !important;
        right: 12px !important;
        transform: none !important;
        width: auto !important;
        min-width: unset !important;
        border-radius: 20px !important;
        padding: 10px 14px !important;
        gap: 8px !important;
        box-shadow: 0 16px 36px rgba(0, 0, 0, 0.45) !important;
        justify-content: space-between !important;
    }
}

/* ========================================
   GLOBAL FILTER GRID & TAB COMPONENT STYLES
   ======================================== */

/* Tab Navigation System */
.card-header-tabs {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 20px;
    background: #f8fafc;
    border-bottom: 1px solid #e2e8f0;
    border-top-left-radius: var(--radius-lg, 12px);
    border-top-right-radius: var(--radius-lg, 12px);
}

.tab-nav-group {
    display: inline-flex !important;
    align-items: center !important;
    gap: 4px !important;
    background: #f1f5f9 !important;
    padding: 4px !important;
    border-radius: 10px !important;
    border: 1px solid #cbd5e1 !important;
}

.tab-nav-btn {
    display: inline-flex !important;
    align-items: center !important;
    gap: 8px !important;
    padding: 8px 18px !important;
    font-size: 13px !important;
    font-weight: 600 !important;
    color: #475569 !important;
    background: transparent !important;
    border: none !important;
    border-radius: 8px !important;
    cursor: pointer !important;
    transition: all 0.15s ease-in-out !important;
    white-space: nowrap !important;
    line-height: 1.4 !important;
}

.tab-nav-btn i {
    width: 16px !important;
    height: 16px !important;
}

.tab-nav-btn:hover {
    color: #0f172a !important;
    background: rgba(255, 255, 255, 0.7) !important;
}

.tab-nav-btn.active {
    background: #ffffff !important;
    color: #2563eb !important;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12), 0 1px 2px rgba(0, 0, 0, 0.08) !important;
}

.tab-badge {
    background: rgba(37, 99, 235, 0.12);
    color: #2563eb;
    font-size: 11px;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 20px;
}

.tab-badge.badge-danger {
    background: rgba(220, 38, 38, 0.12);
    color: #dc2626;
}

.tab-badge.badge-warning {
    background: rgba(217, 119, 6, 0.12);
    color: #d97706;
}

/* Filter Grid - Horizontal Inline Layout for Desktop */
@media (min-width: 768px) {
    .filter-form .filter-grid,
    .filter-grid {
        display: flex !important;
        flex-direction: row !important;
        flex-wrap: wrap !important;
        align-items: flex-end !important;
        gap: 12px !important;
    }

    .filter-grid .form-group {
        flex: 1 1 180px !important;
        min-width: 150px !important;
        margin-bottom: 0 !important;
    }

    .filter-grid button,
    .filter-grid .btn {
        height: 42px !important;
        white-space: nowrap !important;
    }
}

/* Mobile Responsive Adjustments */
@media (max-width: 767px) {
    .filter-form .filter-grid,
    .filter-grid {
        display: grid !important;
        grid-template-columns: 1fr !important;
        gap: 12px !important;
    }

    html, body, .admin-layout, .main-content {
        overflow-x: hidden;
        max-width: 100vw;
    }

    .content-container {
        padding-left: 12px !important;
        padding-right: 12px !important;
    }

    .card {
        margin-left: 0 !important;
        margin-right: 0 !important;
    }

    .pagination {
        display: flex;
        flex-wrap: wrap;
        justify-content: center;
        gap: 6px;
        margin: 20px 0;
    }

    .pagination-link {
        min-width: 32px;
        height: 32px;
        display: flex;
        align-items: center;
        justify-content: center;
        padding: 0 8px;
        background: white;
        border: 1px solid var(--slate-200);
        border-radius: 6px;
        font-size: 14px;
        color: var(--slate-700);
        text-decoration: none;
    }

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

/* Global Date Input Fix - Prevent squeezing date text & calendar icon */
input[type="date"] {
    min-width: 155px !important;
    padding-left: 10px !important;
    padding-right: 8px !important;
}