html {
    overflow-x: hidden;
}

:root {
    --primary: #2563eb;
    --primary-dark: #1e40af;
    --header-bg: #ffffff;
    --bg-color: #f1f5f9;
    --text-main: #1e293b;
    --text-light: #64748b;
    --border: #e2e8f0;
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

* {
    box-sizing: border-box;
    outline: none;
    -webkit-tap-highlight-color: transparent;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

/* Global Normalization */
input,
select,
textarea,
button {
    font-family: inherit;
    font-size: inherit;
    color: inherit;
    border: 1px solid var(--border);
    background: white;
    border-radius: 8px;
    transition: all 0.2s;
}

select {
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
}

/* Ensure checkboxes and radio buttons are visible */
input[type="checkbox"],
input[type="radio"] {
    -webkit-appearance: checkbox !important;
    -moz-appearance: checkbox !important;
    appearance: checkbox !important;
    width: 18px;
    height: 18px;
    cursor: pointer;
    border: 1px solid #cbd5e1;
}

input:focus,
select:focus,
textarea:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

select {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%2364748b'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 9l-7 7-7-7'%3E%3C/path%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
    background-size: 1rem;
    padding-right: 2.5rem !important;
    cursor: pointer;
}

.searchable-select-wrapper {
    position: relative;
    display: flex;
    flex-direction: column;
    width: 100%;
}

.searchable-select-input {
    width: 100% !important;
    padding: 8px 12px;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    font-size: 0.9rem;
    background: white;
    box-sizing: border-box;
    cursor: text;
    appearance: none !important;
    -webkit-appearance: none !important;
}

.searchable-select-wrapper select {
    display: none !important;
}

.searchable-results-list {
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    z-index: 1000;
    margin-top: 4px;
    border: 1px solid #3b82f6;
    border-radius: 8px;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    background: white;
    max-height: 200px;
    overflow-y: auto;
}

.searchable-item {
    padding: 10px 12px;
    cursor: pointer;
    font-size: 0.9rem;
    border-bottom: 1px solid #f1f5f9;
    color: #1e293b;
}

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

.searchable-item:hover,
.searchable-item.selected {
    background: #eff6ff;
    color: #2563eb;
}

.searchable-item.no-results {
    color: #94a3b8;
    text-align: center;
    cursor: default;
}

.searchable-select-wrapper select option {
    padding: 8px;
}

body {
    margin: 0;
    font-family: 'Inter', sans-serif;
    background: var(--bg-color);
    color: var(--text-main);
    height: 100vh;
    overflow: hidden;
    max-width: 100vw;
}

.hidden {
    display: none !important;
}

/* Mobile Blocker - disabled, app works on all screen sizes */
#mobile-blocker {
    display: none !important;
}

/* Hamburger Button */
#hamburger-btn {
    display: none;
    background: none;
    border: none;
    font-size: 1.4rem;
    color: var(--text-light);
    cursor: pointer;
    padding: 5px 8px;
    border-radius: 6px;
}

#hamburger-btn:hover {
    background: #f1f5f9;
    color: var(--primary);
}

/* Mobile Nav Drawer */
#mobile-nav-drawer {
    position: fixed;
    top: 0;
    left: 0;
    width: 280px;
    height: 100%;
    background: white;
    z-index: 9000;
    box-shadow: 4px 0 20px rgba(0,0,0,0.15);
    flex-direction: column;
    overflow-y: auto;
    transform: translateX(-100%);
    transition: transform 0.3s ease;
    display: none;
}

#mobile-nav-drawer.open {
    transform: translateX(0);
}

#mobile-nav-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    z-index: 8999;
}

.mobile-nav-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px;
    border-bottom: 1px solid var(--border);
}

.mobile-nav-links {
    display: flex;
    flex-direction: column;
    padding: 15px;
    gap: 5px;
}

.mobile-nav-links .nav-link {
    padding: 12px 15px;
    border-radius: 8px;
    font-size: 0.95rem;
}

@media (max-width: 1023px) {
    #hamburger-btn {
        display: flex;
        align-items: center;
    }

    #main-header .top-nav {
        display: none !important;
    }
}

/* Header Layout */
#main-header {
    height: 70px;
    background: var(--header-bg);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
    box-shadow: var(--shadow);
    z-index: 1000;
    position: sticky;
    top: 0;
    flex-shrink: 0;
    min-width: 0;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
    min-width: 0;
    overflow: hidden;
}

.logo {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--primary);
    display: flex;
    gap: 8px;
    align-items: center;
    white-space: nowrap;
    flex-shrink: 0;
}

.top-nav {
    display: flex;
    gap: 2px;
    overflow-x: auto;
    overflow-y: hidden;
    scrollbar-width: none;
    -ms-overflow-style: none;
    flex: 1;
    min-width: 0;
}

.top-nav::-webkit-scrollbar {
    display: none;
}

.nav-link {
    text-decoration: none;
    color: var(--text-light);
    padding: 8px 10px;
    border-radius: 8px;
    font-weight: 500;
    font-size: 0.88rem;
    transition: all 0.2s;
    display: flex;
    gap: 6px;
    align-items: center;
    white-space: nowrap;
    flex-shrink: 0;
}

.nav-link:hover,
.nav-link.active {
    background: #eff6ff;
    color: var(--primary);
}

.header-right {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
    position: relative;
    z-index: 1001;
}

.user-name {
    font-weight: 600;
}

#logout-btn {
    background: none;
    border: none;
    font-size: 1.2rem;
    cursor: pointer;
    color: var(--text-light);
}

#logout-btn:hover {
    color: #ef4444;
}

/* Main Content */
#main-content {
    height: calc(100vh - 70px);
    overflow-y: auto;
    padding: 30px;
}

#view-container {
    max-width: 1800px;
    margin: 0 auto;
}

/* Cards & Grid */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}

.stat-card {
    background: white;
    padding: 25px;
    border-radius: 12px;
    box-shadow: var(--shadow);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 20px;
}

.project-card {
    background: white;
    border-radius: 12px;
    padding: 20px;
    box-shadow: var(--shadow);
    border-left: 5px solid #ccc;
    display: flex;
    flex-direction: column;
    gap: 15px;
    min-width: 0;
    word-break: break-word;
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: start;
}

.card-header h3 {
    margin: 0;
    font-size: 1.1rem;
}

.status-badge {
    font-size: 0.75rem;
    padding: 4px 8px;
    background: #f1f5f9;
    border-radius: 4px;
}

.card-users {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.users-list {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
}

.user-badge {
    background: #e0f2fe;
    color: #0369a1;
    font-size: 0.75rem;
    padding: 2px 8px;
    border-radius: 10px;
}

/* Buttons */
.btn-primary {
    background: var(--primary);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 500;
}

.btn-primary:hover {
    background: var(--primary-dark);
}

.btn-secondary {
    background: #e2e8f0;
    color: var(--text-main);
    border: none;
    padding: 8px 12px;
    border-radius: 6px;
    cursor: pointer;
}

.btn-sm {
    padding: 5px 10px;
    font-size: 0.85rem;
}

/* Tables */
.table-container {
    background: white;
    border-radius: 12px;
    padding: 20px;
    box-shadow: var(--shadow);
    overflow-x: auto;
    min-height: 420px;
}

table {
    width: 100%;
    border-collapse: collapse;
}

th,
td {
    padding: 15px;
    text-align: left;
    border-bottom: 1px solid #e2e8f0;
}

th {
    font-weight: 600;
    color: var(--text-light);
    font-size: 0.9rem;
}

/* Modals */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 200;
}

.modal-content {
    background: white;
    width: 800px;
    max-width: 95%;
    padding: 25px;
    border-radius: 12px;
    animation: popIn 0.2s;
    max-height: 90vh;
    overflow-y: auto;
}

@keyframes popIn {
    from {
        transform: scale(0.9);
        opacity: 0;
    }

    to {
        transform: scale(1);
        opacity: 1;
    }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 20px;
}

.close-modal {
    cursor: pointer;
    font-size: 1.5rem;
}

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

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-size: 0.9rem;
    font-weight: 500;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
}

/* Login */
.login-wrapper {
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f8fafc;
}

.login-box {
    background: white;
    padding: 40px;
    border-radius: 16px;
    width: 400px;
    box-shadow: var(--shadow);
}

/* Loader */
.loader-container {
    display: flex;
    justify-content: center;
    padding: 50px;
}

.loader {
    width: 40px;
    height: 40px;
    border: 4px solid #e2e8f0;
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Lang Dropdown */
.lang-dropdown:hover .lang-content {
    display: flex !important;
}

/* Premium Dashboard Styles */
.glass-card {
    background: #ffffff;
    /* Solid white for performance */
    border: 1px solid #e2e8f0;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
    /* Lighter shadow */
    border-radius: 16px;
    padding: 25px;
    transition: transform 0.2s;
    /* Removed backdrop-filter: blur(10px) to prevent high GPU usage */
}

.glass-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
}

.dashboard-charts-grid,
.dashboard-bottom-grid {
    display: grid;
    gap: 25px;
    margin-top: 25px;
}

/* Desktop Layouts */
@media (min-width: 1024px) {
    .dashboard-charts-grid {
        grid-template-columns: 2fr 1fr;
    }

    .dashboard-bottom-grid {
        grid-template-columns: 1fr 1fr;
    }
}

/* Mobile/Tablet: Stack them */
@media (max-width: 1023px) {

    .dashboard-charts-grid,
    .dashboard-bottom-grid {
        grid-template-columns: 1fr;
    }
}

.gradient-text {
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    font-weight: 800;
}

.grad-blue {
    background-image: linear-gradient(135deg, #2563eb 0%, #a855f7 100%);
}

.grad-green {
    background-image: linear-gradient(135deg, #10b981 0%, #06b6d4 100%);
}

.grad-orange {
    background-image: linear-gradient(135deg, #f97316 0%, #f43f5e 100%);
}

.progress-bar-bg {
    background: #f1f5f9;
    border-radius: 10px;
    height: 8px;
    width: 100%;
    margin-top: 8px;
    overflow: hidden;
}

.progress-bar-fill {
    height: 100%;
    border-radius: 10px;
    transition: width 1s ease-in-out;
}

.activity-item {
    display: flex;
    gap: 15px;
    padding: 12px 0;
    border-bottom: 1px solid #f1f5f9;
}

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

.activity-icon {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: #f8fafc;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-light);
}

/* Toast Notifications */
#toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 10000;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.toast {
    min-width: 300px;
    background: white;
    padding: 15px 20px;
    border-radius: 8px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    display: flex;
    align-items: center;
    justify-content: space-between;
    animation: slideIn 0.3s ease-out;
    border-left: 4px solid #cbd5e1;
}

.toast.success {
    border-left-color: #22c55e;
}

.toast.error {
    border-left-color: #ef4444;
}

.toast-content {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.95rem;
    color: #334155;
}

.toast-close {
    cursor: pointer;
    color: #94a3b8;
    margin-left: 10px;
}

.toast-close:hover {
    color: #64748b;
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }

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

@keyframes slideOut {
    from {
        transform: translateX(0);
        opacity: 1;
    }

    to {
        transform: translateX(100%);
        opacity: 0;
    }
}
/* Modern Permissions UI */
.perm-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
    gap: 12px;
    margin-top: 10px;
}

.perm-card {
    position: relative;
    cursor: pointer;
    user-select: none;
}

.perm-card input[type="checkbox"] {
    position: absolute;
    opacity: 0;
    cursor: pointer;
    height: 0;
    width: 0;
}

.perm-label {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 15px;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    color: #475569;
    font-size: 0.9rem;
    font-weight: 500;
}

.perm-label:hover {
    background: #f8fafc;
    border-color: #cbd5e1;
    transform: translateY(-1px);
}

.perm-card input[type="checkbox"]:checked + .perm-label {
    background: #eff6ff;
    border-color: #3b82f6;
    color: #2563eb;
    box-shadow: 0 4px 6px -1px rgba(37, 99, 235, 0.1);
}

.perm-card input[type="checkbox"]:checked + .perm-label:before {
    content: '\f00c';
    font-family: 'Font Awesome 5 Free';
    font-weight: 900;
    margin-right: 2px;
}

/* Kanban tabs — sadece mobilde görünür */
.kanban-tabs {
    display: none;
}

/* ===== KANBAN BOARD (Desktop Base) ===== */
.kanban-board {
    display: flex;
    gap: 15px;
    overflow-x: hidden;
    overflow-y: hidden;
    padding-bottom: 20px;
    height: calc(100vh - 160px);
    width: 100%;
}

.kanban-column {
    flex: 1;
    min-width: 0;
    background: #f8fafc;
    padding: 15px;
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    border: 1px solid #e2e8f0;
}

.kanban-col-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 2px solid #e2e8f0;
}

.kanban-col-header h3 {
    margin: 0;
    font-size: 1rem;
    font-weight: 600;
}

.kanban-col-header .badge {
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 0.75rem;
}

.kanban-items {
    flex: 1;
    overflow-y: auto;
    overflow-x: clip;
    padding-right: 4px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* ===== VIEW HEADER ===== */
.view-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    gap: 12px;
    flex-wrap: wrap;
}

.view-header h2 {
    margin: 0;
}

.contracts-filters {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1;
    flex-wrap: wrap;
}

/* ===== APP LAYOUT ===== */
#app {
    display: flex;
    flex-direction: column;
    height: 100vh;
    overflow: hidden;
}

/* ===== RESPONSIVE STYLES ===== */

/* Tablet (768px – 1023px) */
@media (max-width: 1023px) {
    #main-header {
        padding: 0 12px;
    }

    .header-right {
        gap: 8px;
    }

    #main-content {
        padding: 20px 16px;
        height: calc(100vh - 70px);
    }

    .modal-content {
        width: 95vw !important;
        max-width: 95vw !important;
        padding: 20px;
    }

    .dashboard-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 15px;
    }

    .table-container {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .kanban-board {
        height: calc(100vh - 150px);
    }
}

/* Tablet (768px – 1023px): only kanban tabs */
@media (min-width: 768px) and (max-width: 1023px) {
    .kanban-tabs {
        display: flex;
        gap: 6px;
        overflow-x: auto;
        scrollbar-width: none;
        padding-bottom: 10px;
        margin-bottom: 4px;
        -webkit-overflow-scrolling: touch;
    }
    .kanban-tabs::-webkit-scrollbar { display: none; }

    .kanban-tab {
        flex-shrink: 0;
        padding: 8px 14px;
        border: 1px solid #e2e8f0;
        border-radius: 20px;
        background: white;
        color: #64748b;
        font-size: 0.85rem;
        font-weight: 500;
        cursor: pointer;
        display: flex;
        align-items: center;
        gap: 6px;
        transition: all 0.2s;
    }
    .kanban-tab.active {
        background: #2563eb;
        color: white;
        border-color: #2563eb;
    }
    .kanban-tab-count {
        background: rgba(255,255,255,0.25);
        padding: 1px 6px;
        border-radius: 10px;
        font-size: 0.75rem;
    }
    .kanban-tab:not(.active) .kanban-tab-count {
        background: #f1f5f9;
        color: #475569;
    }

    .kanban-board {
        display: block !important;
        height: auto !important;
        overflow: hidden !important;
        padding-bottom: 20px;
    }
    .kanban-column {
        display: none !important;
        width: 100% !important;
        min-width: unset !important;
        height: auto !important;
    }
    .kanban-column.mobile-active {
        display: flex !important;
    }
    .kanban-items {
        max-height: calc(100vh - 240px);
        overflow-y: auto;
    }
}

/* Mobile (max 767px) */
@media (max-width: 767px) {
    .logo-text {
        display: none !important;
    }

    #main-header {
        height: 56px;
        padding: 0 12px;
    }

    #main-content {
        height: calc(100vh - 56px);
        padding: 14px 12px;
        overflow-x: hidden;
        overflow-y: auto;
    }

    .user-name { display: none; }

    /* Dashboard stat cards: 2 per row */
    .dashboard-grid {
        grid-template-columns: 1fr 1fr;
        gap: 10px;
    }

    .glass-card {
        padding: 14px;
        border-radius: 12px;
    }

    .glass-card h3 {
        font-size: 0.95rem;
        margin-bottom: 12px !important;
    }

    /* Charts full width, stacked */
    .dashboard-charts-grid,
    .dashboard-bottom-grid {
        grid-template-columns: 1fr !important;
        gap: 14px;
        margin-top: 14px;
    }

    /* ── Kanban tabs ── */
    .kanban-tabs {
        display: flex;
        gap: 6px;
        overflow-x: auto;
        scrollbar-width: none;
        padding-bottom: 10px;
        margin-bottom: 4px;
        -webkit-overflow-scrolling: touch;
    }

    .kanban-tabs::-webkit-scrollbar { display: none; }

    .kanban-tab {
        flex-shrink: 0;
        padding: 7px 12px;
        border: 1px solid #e2e8f0;
        border-radius: 20px;
        background: white;
        color: #64748b;
        font-size: 0.82rem;
        font-weight: 500;
        cursor: pointer;
        display: flex;
        align-items: center;
        gap: 5px;
        transition: all 0.2s;
    }

    .kanban-tab.active {
        background: #2563eb;
        color: white;
        border-color: #2563eb;
    }

    .kanban-tab-count {
        background: rgba(255,255,255,0.25);
        padding: 1px 6px;
        border-radius: 10px;
        font-size: 0.72rem;
    }

    .kanban-tab:not(.active) .kanban-tab-count {
        background: #f1f5f9;
        color: #475569;
    }

    /* ── Kanban → 1 sütun, tab ile ── */
    .kanban-board {
        display: block !important;
        height: auto !important;
        overflow-x: hidden !important;
        padding-bottom: 20px;
    }

    .kanban-column {
        display: none !important;
        min-width: unset !important;
        max-width: unset !important;
        width: 100% !important;
        height: auto !important;
    }

    .kanban-column.mobile-active {
        display: flex !important;
    }

    .kanban-items {
        max-height: calc(100vh - 260px);
        overflow-y: auto;
        gap: 8px;
    }


    /* Modals bottom sheet */
    .modal-overlay {
        align-items: flex-end;
        padding: 0;
    }

    .modal-content {
        width: 100vw !important;
        max-width: 100vw !important;
        max-height: 92vh !important;
        border-radius: 16px 16px 0 0 !important;
        padding: 20px 16px !important;
        margin: 0 !important;
    }

    /* Forms */
    .form-group input,
    .form-group select,
    .form-group textarea {
        font-size: 16px;
        padding: 11px 12px;
    }

    .btn-primary, .btn-secondary {
        padding: 10px 16px;
        font-size: 0.9rem;
        border-radius: 8px;
        min-height: 42px;
    }

    .view-header { flex-wrap: wrap; }

    /* Login */
    .login-wrapper { padding: 20px; }
    .login-box {
        width: 100%;
        padding: 28px 20px;
        border-radius: 16px;
    }

    /* Toast */
    #toast-container {
        right: 10px;
        left: 10px;
        bottom: 20px;
        top: auto;
    }

    .toast { min-width: unset; width: 100%; }

    .stat-card { padding: 14px; }

    .perm-grid {
        grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    }
}

/* Small phones (max 479px) */
@media (max-width: 479px) {
    .dashboard-grid {
        grid-template-columns: 1fr 1fr;
        gap: 8px;
    }

    #main-content {
        padding: 8px;
    }
}

/* ===== TABLE PAGES (employees, services, owner_companies, hosting, roles) ===== */

/* table-container'ın yatay scroll çalışması için
   #main-content overflow-x: hidden kaldırılıp sadece body/html'de tutulur */
#main-content {
    overflow-x: visible;
}

@media (max-width: 767px) {
    /* View header — mobilde düzgün görünsün */
    .view-header {
        flex-wrap: wrap;
        gap: 10px;
        margin-bottom: 14px;
    }

    .view-header h2 {
        font-size: 1.1rem;
    }

    /* Table container — no horizontal scroll needed, columns hidden */
    .table-container {
        overflow-x: visible;
        border-radius: 10px;
        padding: 12px;
    }

    /* Orta sütunları gizle — sadece 1. (ad) ve son (butonlar) kalsın */
    .table-container th:not(:first-child):not(:last-child),
    .table-container td:not(:first-child):not(:last-child),
    #hosting-table-container th:not(:first-child):not(:last-child),
    #hosting-table-container td:not(:first-child):not(:last-child) {
        display: none;
    }

    table {
        min-width: unset;
        width: 100%;
    }

    th, td {
        padding: 12px 10px;
        font-size: 0.88rem;
        white-space: normal;
    }

    /* Ad sütunu tam genişlik */
    .table-container td:first-child,
    .table-container th:first-child {
        width: 100%;
    }

    /* Buton sütunu sıkışmasın */
    .table-container td:last-child,
    .table-container th:last-child,
    #hosting-table-container td:last-child,
    #hosting-table-container th:last-child {
        white-space: nowrap;
        text-align: right;
    }

    /* Modal form grid'leri 1 sütuna indir */
    .modal-content [style*="grid-template-columns: 1fr 1fr"],
    .modal-content [style*="grid-template-columns:1fr 1fr"] {
        grid-template-columns: 1fr !important;
    }

    /* Hosting header butonları wrap et */
    .tw-flex.tw-gap-3,
    [class*="tw-flex"][class*="tw-gap"] {
        flex-wrap: wrap;
    }

    /* Hosting arama input tam genişlik */
    #hosting-search {
        max-width: 100% !important;
    }

    /* Hosting tablo sarmalayıcı */
    #hosting-table-container {
        overflow-x: auto !important;
        -webkit-overflow-scrolling: touch;
    }

    /* Hosting detay satırı */
    #hosting-table-body td[colspan] > div {
        padding: 10px !important;
    }

    /* Contracts header filterleri */
    .contracts-filters {
        display: flex;
        flex-wrap: wrap;
        gap: 8px;
        width: 100%;
    }

    .contracts-filters select,
    .contracts-filters input[type="text"] {
        flex: 1;
        min-width: 120px;
        max-width: 100%;
        font-size: 0.85rem !important;
        padding: 7px 10px !important;
    }

    .contracts-filters > div {
        flex: 1;
        min-width: 160px;
    }

    /* Roles — permissions badge'leri küçük */
    .user-badge {
        font-size: 0.7rem;
        padding: 2px 6px;
    }

    /* perm-grid modal içinde */
    .perm-grid {
        grid-template-columns: repeat(auto-fill, minmax(90px, 1fr));
        gap: 8px;
    }

    .perm-label {
        padding: 8px 10px;
        font-size: 0.8rem;
    }
}

/* Logo küçültme — 375px ve altı */
@media (max-width: 375px) {
    .logo-text {
        display: none !important;
    }

    .logo i {
        font-size: 1rem;
    }

    #hamburger-btn {
        font-size: 1.1rem;
    }

    #main-header {
        padding: 0 8px;
    }

    .header-right {
        gap: 6px;
    }
}
