/* --- DESIGN SYSTEM & CSS VARIABLES --- */
:root {
    --bg-main: #070b15;
    --bg-sidebar: #0b1122;
    --bg-card: rgba(20, 28, 48, 0.45);
    --border-color: rgba(255, 255, 255, 0.07);
    --border-highlight: rgba(79, 70, 229, 0.35);
    
    --color-primary: #5c5efa;
    --color-primary-hover: #4a4cd9;
    --color-primary-glow: rgba(92, 94, 250, 0.25);
    
    --color-success: #10b981;
    --color-success-glow: rgba(16, 185, 129, 0.2);
    
    --color-warning: #f59e0b;
    --color-warning-glow: rgba(245, 158, 11, 0.2);
    
    --color-danger: #ef4444;
    --color-danger-glow: rgba(239, 68, 68, 0.2);
    
    --color-blue: #3b82f6;
    --color-blue-glow: rgba(59, 130, 246, 0.2);
    
    --text-main: #f3f4f6;
    --text-muted: #9ca3af;
    --text-highlight: #ffffff;
    
    --glass-blur: blur(12px) saturate(180%);
    --font-heading: 'Outfit', sans-serif;
    --font-body: 'Inter', sans-serif;
    --transition-smooth: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* --- GENERAL RESET --- */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: var(--font-body);
}
html, body {
    background-color: var(--bg-main);
    color: var(--text-main);
    overflow: hidden;
    max-width: 100%;
    height: 100vh;
    touch-action: manipulation;
    -webkit-text-size-adjust: 100%;
    -ms-text-size-adjust: 100%;
    text-size-adjust: 100%;
}

input, select, textarea, button {
    touch-action: manipulation;
}

@media screen and (max-width: 768px) {
    input, select, textarea {
        font-size: 16px !important;
    }
}
/* --- APP LAYOUT --- */
.app-container {
    display: flex;
    height: 100vh;
    width: 100%;
    max-width: 100%;
    overflow: hidden;
}

/* --- SIDEBAR STYLE --- */
.sidebar {
    width: 260px;
    background-color: var(--bg-sidebar);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    z-index: 10;
}
.sidebar-header {
    padding: 24px;
    border-bottom: 1px solid var(--border-color);
}
.logo {
    display: flex;
    align-items: center;
    gap: 12px;
}
.logo-icon {
    font-size: 24px;
    color: var(--color-primary);
    filter: drop-shadow(0 0 8px var(--color-primary-glow));
}
.logo-text {
    display: flex;
    flex-direction: column;
}
.logo-title {
    font-family: var(--font-heading);
    font-weight: 800;
    font-size: 18px;
    letter-spacing: 1.5px;
    color: var(--text-highlight);
}
.logo-subtitle {
    font-size: 10px;
    letter-spacing: 0.5px;
    color: var(--text-muted);
}
.sidebar-nav {
    flex-grow: 1;
    padding: 20px 14px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    color: var(--text-muted);
    text-decoration: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    transition: var(--transition-smooth);
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    color: var(--text-muted);
    text-decoration: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    transition: var(--transition-smooth);
}
.nav-item i {
    font-size: 16px;
    width: 20px;
}
.nav-item:hover, .nav-item.active {
    color: var(--text-highlight);
    background: rgba(255, 255, 255, 0.04);
}
.nav-item.active {
    background: linear-gradient(135deg, var(--color-primary), #3b82f6);
    box-shadow: 0 4px 15px var(--color-primary-glow);
}
.sidebar-footer {
    padding: 20px;
    border-top: 1px solid var(--border-color);
}
.user-profile {
    display: flex;
    align-items: center;
    gap: 12px;
}
.user-avatar {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: linear-gradient(135deg, #3b82f6, var(--color-primary));
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-family: var(--font-heading);
    color: var(--text-highlight);
}

.user-info {
    display: flex;
    flex-direction: column;
}

.user-name {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-highlight);
}
.user-role {
    font-size: 10px;
    color: var(--text-muted);
}
/* --- MAIN CONTENT STYLE --- */
.main-content {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    height: 100vh;
    overflow-y: auto;
    background: radial-gradient(circle at top right, rgba(92, 94, 250, 0.05), transparent 600px);
}
.content-header {
    padding: 18px 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border-color);
}

.content-body {
    padding: 18px 24px;
    flex-grow: 1;
    overflow-y: auto;
    width: 100%;
    box-sizing: border-box;
}


/* Cookie Hukuk Asistanı sekmesinde üst bar (top bar) gizlenir */
.main-content:has(#tab-asistan.active) > .content-header {
    display: none !important;
}
.main-content:has(#tab-asistan.active) #tab-asistan {
    height: 100vh !important;
}
.main-content:has(#tab-asistan.active) .asistan-chat-container {
    height: 100% !important;
}

.content-header h1 {
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 26px;
    color: var(--text-highlight);
}
.text-muted {
    color: var(--text-muted);
    font-size: 14px;
}

/* --- GLASS PANEL --- */
.glass-panel {
    background: var(--bg-card);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    transition: var(--transition-smooth);
}
.glass-panel:hover {
    border-color: rgba(255, 255, 255, 0.12);
}


/* --- STATS GRID --- */
.stats-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
    padding: 24px 32px 16px 32px;
}

.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 16px;
    transition: var(--transition-smooth);
}
.stat-card:hover {
    transform: translateY(-2px);
    border-color: var(--border-highlight);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
}
.stat-icon-wrapper {
    width: 48px;
    height: 48px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    color: var(--text-highlight);
}
.blue-glow {
    background: var(--color-blue-glow);
    color: var(--color-blue);
}
.purple-glow {
    background: var(--color-primary-glow);
    color: var(--color-primary);
}
.green-glow {
    background: var(--color-success-glow);
    color: var(--color-success);
}
.red-glow {
    background: var(--color-danger-glow);
    color: var(--color-danger);
}
.stat-data {
    display: flex;
    flex-direction: column;
}
.stat-val {
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 24px;
    color: var(--text-highlight);
}
.stat-lbl {
    font-size: 12px;
    color: var(--text-muted);
}
/* --- BUTTONS --- */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 18px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition-smooth);
    border: none;
}

.btn-primary {
    background: linear-gradient(135deg, var(--color-primary), #3b82f6);
    color: var(--text-highlight);
}

.btn-primary:hover {
    filter: brightness(1.1);
    transform: translateY(-1px);
}

.btn-glow {
    box-shadow: 0 4px 15px var(--color-primary-glow);
}

.btn-outline {
    background: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-main);
}

.btn-outline:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.2);
}

.btn-xs {
    padding: 6px 12px;
    font-size: 11px;
    border-radius: 6px;
}
.btn-sm {
    padding: 8px 14px;
    font-size: 12px;
}
.btn-block {
    width: 100%;
    justify-content: center;
}
/* --- DASHBOARD SECTIONS --- */
.dashboard-sections {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
    padding: 0 32px 32px 32px;
}
.content-card {
    height: 480px;
    display: flex;
    flex-direction: column;
}
.card-header {
    padding: 20px;
    border-bottom: 1px solid var(--border-color);
}
.card-header h3 {
    font-family: var(--font-heading);
    font-weight: 600;
    font-size: 16px;
    color: var(--text-highlight);
}
.card-body {
    flex-grow: 1;
    overflow-y: auto;
    padding: 16px;
}
/* --- TIMELINE LIST --- */
.timeline-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.timeline-item {
    display: flex;
    gap: 16px;
    padding: 14px;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    transition: var(--transition-smooth);
}
.timeline-item:hover {
    border-color: var(--border-highlight);
    background: rgba(255, 255, 255, 0.04);
}
.timeline-date-box {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 54px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 8px;
    padding: 6px;
    font-family: var(--font-heading);
    flex-shrink: 0;
}
.timeline-day {
    font-size: 16px;
    font-weight: 700;
    color: var(--text-highlight);
}
.timeline-month {
    font-size: 10px;
    text-transform: uppercase;
    color: var(--text-muted);
}
.timeline-info {
    display: flex;
    flex-direction: column;
    justify-content: center;
    flex-grow: 1;
}
.timeline-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-highlight);
}
.timeline-meta {
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 4px;
}
.timeline-type-badge {
    align-self: center;
    padding: 4px 8px;
    font-size: 10px;
    font-weight: 600;
    border-radius: 6px;
    text-transform: uppercase;
}
.badge-durusma {
    background: var(--color-success-glow);
    color: var(--color-success);
}
.badge-deadline {
    background: var(--color-danger-glow);
    color: var(--color-danger);
}
/* --- TAB ROUTING --- */
.tab-content {
    display: none;
    animation: fadeIn 0.4s ease;
}
.tab-content.active {
    display: block;
}
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(4px); }
    to { opacity: 1; transform: translateY(0); }
}
/* --- FILTER BAR --- */
.filter-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 32px 20px 32px;
}
.search-input-wrapper {
    position: relative;
    width: 320px;
}
.search-input-wrapper i {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
}
.search-input-wrapper input {
    width: 100%;
    padding: 10px 14px 10px 40px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-main);
    font-size: 13px;
    transition: var(--transition-smooth);
}
.search-input-wrapper input:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 10px var(--color-primary-glow);
}
/* --- DATA TABLE --- */
.table-container {
    margin: 0 32px 32px 32px;
    overflow-x: auto;
}
.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
    text-align: left;
}
.data-table th, .data-table td {
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-color);
}
.data-table th {
    font-family: var(--font-heading);
    font-weight: 600;
    color: var(--text-highlight);
    background: rgba(255, 255, 255, 0.01);
}
.data-table tbody tr {
    transition: var(--transition-smooth);
}
.data-table tbody tr:hover {
    background: rgba(255, 255, 255, 0.02);
}
.text-right {
    text-align: right;
}
.action-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 14px;
    padding: 6px;
    cursor: pointer;
    border-radius: 4px;
    transition: var(--transition-smooth);
}
.action-btn:hover {
    color: var(--text-highlight);
    background: rgba(255, 255, 255, 0.05);
}
.action-btn.delete:hover {
    color: var(--color-danger);
    background: var(--color-danger-glow);
}
.action-btn.complete:hover {
    color: #10b981;
    background: rgba(16, 185, 129, 0.15);
}
.timeline-complete-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 16px;
    padding: 4px;
    margin-left: 2px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition-smooth);
}
.timeline-complete-btn:hover {
    color: #10b981;
    transform: scale(1.2);
}
/* --- BADGES --- */
.badge {
    display: inline-flex;
    padding: 4px 8px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 500;
}
.badge-ceza { background: rgba(239, 68, 68, 0.15); color: #f87171; }
.badge-hukuk { background: rgba(59, 130, 246, 0.15); color: #60a5fa; }
.badge-idari { background: rgba(139, 92, 246, 0.15); color: #a78bfa; }
.badge-vergi { background: rgba(20, 184, 166, 0.15); color: #2dd4bf; }
.badge-icra { background: rgba(245, 158, 11, 0.15); color: #fbbf24; }
.badge-aile { background: rgba(236, 72, 153, 0.15); color: #f472b6; }
.badge-sorusturma { background: rgba(139, 92, 246, 0.15); color: #a78bfa; }
.badge-kovusturma { background: rgba(239, 68, 68, 0.15); color: #f87171; }
.badge-sair { background: rgba(107, 114, 128, 0.15); color: #9ca3af; }
.status-badge {
    padding: 3px 8px;
    border-radius: 50px;
    font-size: 11px;
    font-weight: 600;
    white-space: nowrap;
    display: inline-block;
}
.status-devam { background: var(--color-success-glow); color: var(--color-success); }
.status-karar { background: var(--color-blue-glow); color: var(--color-blue); }
.status-kapali { background: rgba(255,255,255,0.05); color: var(--text-muted); }
/* --- CALENDAR LAYOUT --- */
.calendar-layout {
    display: grid;
    grid-template-columns: 320px 1fr;
    gap: 24px;
    padding: 0 32px 32px 32px;
}
.calendar-sidebar, .calendar-main {
    padding: 24px;
    height: 600px;
    display: flex;
    flex-direction: column;
}
.calendar-sidebar h3, .calendar-main h3 {
    font-family: var(--font-heading);
    margin-bottom: 20px;
    font-size: 18px;
}
.event-form {
    display: flex;
    flex-direction: column;
    gap: 16px;
    overflow-y: auto;
}
.form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.form-group-half {
    flex: 1;
}

.flex-group {
    display: flex;
    gap: 12px;
}

.form-group label {
    font-size: 12px;
    color: var(--text-muted);
    font-weight: 500;
}

.form-group input, .form-group select, .form-group textarea {
    padding: 10px 12px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-main);
    font-size: 13px;
    transition: var(--transition-smooth);
}

.form-group input:focus, .form-group select:focus, .form-group textarea:focus {
    outline: none;
    border-color: var(--color-primary);
}

.timeline-container {
    flex-grow: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 14px;
}
/* --- FILE EXPLORER --- */
.file-explorer-container {
    display: flex;
    flex-direction: column;
    gap: 16px;
    padding: 0 32px 32px 32px;
}
.explorer-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 20px;
}
.breadcrumbs {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
}
.breadcrumb-item {
    cursor: pointer;
    color: var(--color-primary);
    font-weight: 500;
}
.breadcrumb-item:hover {
    text-decoration: underline;
}
.breadcrumb-item:not(:last-child)::after {
    content: "/";
    margin-left: 8px;
    color: var(--text-muted);
    display: inline-block;
    text-decoration: none;
}
.file-grid-layout {
    display: grid;
    grid-template-columns: 1fr;
    gap: 20px;
}
.file-list-view {
    height: 520px;
    display: flex;
    flex-direction: column;
}
.file-list-header {
    display: flex;
    padding: 12px 20px;
    border-bottom: 1px solid var(--border-color);
    font-size: 12px;
    font-weight: 600;
    color: var(--text-muted);
}
..col-name { flex-grow: 1; }
.col-size { width: 100px; text-align: right; }
.file-items-list {
    flex-grow: 1;
    overflow-y: auto;
}
.file-row-item {
    display: flex;
    align-items: center;
    padding: 12px 20px;
    border-bottom: 1px solid rgba(255,255,255,0.02);
    cursor: pointer;
    transition: var(--transition-smooth);
    font-size: 13px;
}
.file-row-item:hover {
    background: rgba(255,255,255,0.03);
}
.file-row-item i {
    font-size: 16px;
    margin-right: 12px;
    width: 20px;
    text-align: center;
}
.file-row-item.dir-type i { color: #f59e0b; }
.file-row-item.file-type i { color: #60a5fa; }
.file-row-item.udf-type i { color: #a78bfa; }
.file-row-name {
    flex-grow: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.file-row-size {
    width: 100px;
    text-align: right;
    color: var(--text-muted);
}
/* --- PREVIEW PANE --- */
.file-preview-pane {
    height: 520px;
    display: flex;
    flex-direction: column;
}
.preview-empty {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 40px;
    gap: 16px;
}
.preview-empty-icon {
    font-size: 48px;
    color: rgba(255,255,255,0.05);
}
.preview-content {
    display: flex;
    flex-direction: column;
    height: 100%;
}
.preview-header {
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.preview-header h4 {
    font-size: 14px;
    font-weight: 600;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 200px;
}
.preview-actions {
    display: flex;
    gap: 8px;
}
.preview-body {
    flex-grow: 1;
    overflow-y: auto;
    padding: 20px;
    background: rgba(0,0,0,0.2);
}
.udf-preview-wrapper {
    font-family: 'Times New Roman', Times, serif;
    font-size: 14px;
    color: #f3f4f6;
    line-height: 1.6;
    white-space: pre-wrap;
}
.hidden { display: none !important; }
/* --- ASİSTAN CHAT --- */
.asistan-chat-container {
    height: calc(100vh - 120px);
    margin: 0 32px 32px 32px;
    display: flex;
    flex-direction: column;
}
.chat-header {
    padding: 16px 24px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.asistan-info {
    display: flex;
    align-items: center;
    gap: 12px;
}
.asistan-avatar {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    background: linear-gradient(135deg, var(--color-primary), #818cf8);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    color: var(--text-highlight);
    box-shadow: 0 0 10px var(--color-primary-glow);
}
.asistan-info h4 {
    font-family: var(--font-heading);
    font-size: 14px;
    font-weight: 600;
}
.status-online {
    font-size: 10px;
    color: var(--color-success);
    display: flex;
    align-items: center;
    gap: 6px;
}
.status-online .dot {
    width: 6px;
    height: 6px;
    background: var(--color-success);
    border-radius: 50%;
    display: inline-block;
    box-shadow: 0 0 8px var(--color-success);
}
.chat-messages {
    flex-grow: 1;
    overflow-y: auto;
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}
.message {
    display: flex;
    max-width: 80%;
}
.message.user {
    align-self: flex-end;
}
.message.assistant {
    align-self: flex-start;
}
.message-content {
    padding: 14px 18px;
    border-radius: 12px;
    font-size: 13.5px;
    line-height: 1.5;
}
.message.user .message-content {
    background: var(--color-primary);
    color: var(--text-highlight);
    border-bottom-right-radius: 2px;
    box-shadow: 0 4px 15px var(--color-primary-glow);
}
.message.assistant .message-content {
    background: rgba(255,255,255,0.03);
    border: 1px solid var(--border-color);
    color: var(--text-main);
    border-bottom-left-radius: 2px;
}
.chat-input-area {
    padding: 16px 24px;
    border-top: 1px solid var(--border-color);
    display: flex;
    gap: 12px;
    align-items: center;
}
.chat-input-area textarea {
    flex-grow: 1;
    padding: 12px;
    background: rgba(255,255,255,0.02);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-main);
    font-size: 13.5px;
    resize: none;
    transition: var(--transition-smooth);
}
.chat-input-area textarea:focus {
    outline: none;
    border-color: var(--color-primary);
}
.chat-send-btn {
    height: 44px;
    width: 44px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
/* --- MODALS --- */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: var(--transition-smooth);
    z-index: 10010; /* above the mobile FAB (10005) so an open modal never sits under it */
}
html.modal-open, body.modal-open {
    overflow: hidden !important;
    height: 100% !important;
    position: fixed;
    width: 100%;
}
.modal-overlay.active {
    opacity: 1;
    pointer-events: all;
}

.modal {
    width: 500px;

    max-width: 90%;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    transform: scale(0.95);
    transition: var(--transition-smooth);
    overflow: hidden;
}
.modal form {
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    min-height: 0;
    max-height: calc(90vh - 65px);
    overflow: hidden;
}

.modal-overlay.active .modal {
    transform: scale(1);
}
.modal-header {
    padding: 20px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.modal-header h3 {
    font-family: var(--font-heading);
    font-size: 18px;
    font-weight: 600;
}
.modal-close {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 24px;
    cursor: pointer;
}
.modal-body {
    padding: 20px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 16px;
    -webkit-overflow-scrolling: touch;
    flex: 1 1 auto;
    min-height: 0;
}
.modal-footer {
    padding: 16px 20px;
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: flex-end;
    gap: 12px;
}
/* --- QUICK ACTION MODAL --- */
.quick-modal {
    width: 400px;
}
.quick-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
    padding: 24px;
}
.quick-option-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    padding: 20px 10px;
    background: rgba(255,255,255,0.03);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    cursor: pointer;
    transition: var(--transition-smooth);
    color: var(--text-highlight);
}
.quick-option-btn i {
    font-size: 24px;
}
.quick-option-btn span {
    font-size: 11px;
    font-weight: 600;
}
.quick-option-btn:hover {
    transform: translateY(-2px);
}
.quick-option-btn.blue-theme:hover { border-color: var(--color-blue); color: var(--color-blue); background: var(--color-blue-glow); }
.quick-option-btn.purple-theme:hover { border-color: var(--color-primary); color: var(--color-primary); background: var(--color-primary-glow); }
.quick-option-btn.green-theme:hover { border-color: var(--color-success); color: var(--color-success); background: var(--color-success-glow); }
.quick-option-btn.warning-theme:hover { border-color: var(--color-warning); color: var(--color-warning); background: var(--color-warning-glow); }

/* --- RESPONSIVENESS --- */
@media (max-width: 1024px) {
    .dashboard-sections {
        grid-template-columns: 1fr;
    }
    .calendar-layout {
        grid-template-columns: 1fr;
    }
    .calendar-sidebar {
        height: auto;
    }
    .file-grid-layout {
        grid-template-columns: 1fr;
    }
}

/* --- MOBILE BOTTOM NAVIGATION (FIT ALL 7 BUTTONS ON SCREEN AT ONCE) --- */
.mobile-bottom-nav {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 60px;
    height: calc(60px + env(safe-area-inset-bottom, 0px));
    padding-bottom: env(safe-area-inset-bottom, 0px);
    background: rgba(11, 17, 34, 0.98);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-top: 1px solid var(--border-color);
    z-index: 999;
    box-sizing: border-box;
    overflow: hidden !important;
}
.mobile-bottom-nav::-webkit-scrollbar {
    display: none;
}

/* --- DOCUMENT SCANNER MOBILE FULLSCREEN OPTIMIZATION --- */
@media (max-width: 768px) {
    #scan-crop-modal .modal {
        width: 100% !important;
        max-width: 100% !important;
        height: 100dvh !important;
        max-height: 100dvh !important;
        border-radius: 0 !important;
        margin: 0 !important;
        padding: 0 !important;
    }
    #scan-crop-modal .modal-body {
        padding: 8px 10px !important;
        gap: 8px !important;
        overflow: hidden !important;
    }
    #scan-canvas-wrapper {
        min-height: 220px !important;
        flex: 1 !important;
        max-height: none !important;
        padding: 8px !important;
    }
}


@media (max-width: 768px) {
    .sidebar {
        display: none !important;
    }
    .mobile-bottom-nav {
        display: grid !important;
        grid-template-columns: repeat(6, 1fr) !important;

        align-items: center !important;
        justify-items: center !important;
        position: fixed !important;
        bottom: 0 !important;
        left: 0 !important;
        right: 0 !important;
        width: 100% !important;
        height: 60px !important;
        height: calc(60px + env(safe-area-inset-bottom, 0px)) !important;
        padding-bottom: env(safe-area-inset-bottom, 0px) !important;
        background: rgba(11, 17, 34, 0.98) !important;
        backdrop-filter: blur(16px) !important;
        -webkit-backdrop-filter: blur(16px) !important;
        border-top: 1px solid var(--border-color) !important;
        z-index: 9999 !important;
        overflow: hidden !important;
        padding-left: 2px !important;
        padding-right: 2px !important;
    }
    .mobile-bottom-nav .nav-item {
        width: 100% !important;
        min-width: 0 !important;
        flex: 1 1 0 !important;
        height: 100% !important;
        display: flex !important;
        flex-direction: column !important;
        align-items: center !important;
        justify-content: center !important;
        gap: 3px !important;
        color: var(--text-muted);
        text-decoration: none;
        padding: 4px 0 !important;
        margin: 0 !important;
        transition: var(--transition-smooth);
        border: none;
        background: none;
        cursor: pointer;
        box-sizing: border-box;
    }
    .mobile-bottom-nav .nav-item i {
        font-size: 16px !important;
        width: auto;
    }
    .mobile-bottom-nav .nav-item span {
        font-size: 8.5px !important;
        font-weight: 600;
        white-space: nowrap !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
        max-width: 100% !important;
        text-align: center !important;
        line-height: 1 !important;
        letter-spacing: -0.2px;
    }
    .mobile-bottom-nav .nav-item.active {
        color: var(--color-primary);
        filter: drop-shadow(0 0 6px var(--color-primary-glow));
    }
    .mobile-bottom-nav .nav-item.active i {
        transform: translateY(-1px);
    }



   .nav-scroll-indicator {
        position: absolute;
        top: 0;
        bottom: 0;
        width: 32px;
        display: flex;
        align-items: center;
        justify-content: center;
        pointer-events: none;
        z-index: 1000;
        transition: opacity 0.3s ease;
        opacity: 0;
    }
    .nav-scroll-indicator.visible {
        opacity: 1;
    }
    .nav-scroll-indicator.left {
        left: 0;
        background: linear-gradient(to right, rgba(11, 17, 34, 0.98) 30%, transparent);
        justify-content: flex-start;
        padding-left: 6px;
    }
    .nav-scroll-indicator.right {
        right: 0;
        background: linear-gradient(to left, rgba(11, 17, 34, 0.98) 30%, transparent);
        justify-content: flex-end;
        padding-right: 6px;
    }
    .nav-scroll-indicator i {
        color: var(--text-muted);
        font-size: 12px;
        animation: pulse-arrow 1.5s infinite alternate;
    }
    @keyframes pulse-arrow {
        0% { opacity: 0.3; transform: translateX(0); }
        100% { opacity: 0.9; transform: translateX(2px); }
    }
    .nav-scroll-indicator.left i {
        animation: pulse-arrow-left 1.5s infinite alternate;
    }
    @keyframes pulse-arrow-left {
        0% { opacity: 0.3; transform: translateX(0); }
        100% { opacity: 0.9; transform: translateX(-2px); }
    }
    .main-content {
        width: 100%;
    }
    .content-header {
        padding: 16px 20px;
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }
    .content-header .header-right {
        width: 100%;
    }
    .content-header .header-right .btn {
        width: 100%;
        justify-content: center;
    }
    .stats-grid {
        padding: 16px 20px;
        grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
        gap: 12px;
    }
    .stat-card {
        padding: 14px;
        gap: 10px;
    }
    .stat-icon-wrapper {
        width: 38px;
        height: 38px;
        font-size: 16px;
    }
    .stat-val {
        font-size: 20px;
    }
    .stat-lbl {
        font-size: 11px;
    }
    .dashboard-sections {
        padding: 0 20px 20px 20px;
        gap: 16px;
    }
    .table-container {
        margin: 0 20px 20px 20px;
    }
    .asistan-chat-container {
        margin: 0;
        height: 100%;
    }
    .chat-layout-wrapper {
        height: 100% !important;
        position: relative;
        overflow: hidden;
        padding: 0 20px 20px 20px;
    }
    .main-content:has(#tab-asistan.active) #tab-asistan {
        height: 100% !important;
    }
    .chat-sessions-sidebar {
        position: absolute;
        left: -300px;
        top: 0;
        bottom: 20px;
        z-index: 100;
        width: 260px !important;
        background: #141029 !important;
        box-shadow: 5px 0 15px rgba(0,0,0,0.5);
        transition: left 0.3s ease;
    }
    .chat-sessions-sidebar.active {
        left: 20px !important;
    }
    .mobile-only-inline-btn {
        display: inline-block !important;
    }
    .filter-bar {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
    }
    .filter-bar select, .filter-bar .search-input-wrapper {
        width: 100% !important;
    }
    .filter-bar button {
        width: 100%;
        justify-content: center;
    }
    .filter-bar .btn-primary {
        display: none !important;
    }
    .filter-bar div[style*="flex-grow: 1"] {
        display: none !important;
    }
    .data-table th, .data-table td {
        padding: 10px 8px !important;
        font-size: 12px !important;
    }
    .modal-overlay {
        align-items: flex-end !important;
        justify-content: center !important;
        padding: 0 !important;
    }
    .modal {
        width: 100% !important;
        max-width: 100% !important;
        max-height: 90dvh !important; /* safer viewport-height on mobile */

        margin: 0 !important;
        border-radius: 24px 24px 0 0 !important;
        border: 1px solid rgba(255, 255, 255, 0.08) !important;
        border-bottom: none !important;
        background: #110d26 !important;
        box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.5) !important;
        overflow: hidden !important;
        display: flex !important;
        flex-direction: column !important;
        transform: translateY(100%) !important;
        transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1) !important;
    }
    .modal form {
        display: flex !important;
        flex-direction: column !important;
        flex: 1 1 auto !important;
        min-height: 0 !important;
        overflow: hidden !important;
    }
    .modal-overlay.active .modal {
        transform: translateY(0) !important;
    }
    .modal::before {
        content: "";
        display: block;
        width: 42px;
        height: 5px;
        background: rgba(255, 255, 255, 0.2);
        border-radius: 3px;
        margin: 10px auto 4px auto;
        flex-shrink: 0;
    }
    .modal-header {
        padding: 12px 20px 12px 20px !important;
        border-bottom: 1px solid rgba(255, 255, 255, 0.06) !important;
    }
    .modal-body {
        padding: 12px 16px !important;
        gap: 10px !important;
        overflow-y: auto !important;
        flex: 1 1 auto !important;
        min-height: 0 !important;
        -webkit-overflow-scrolling: touch;
    }
    .modal-body .form-group {
        gap: 4px !important;
        margin-bottom: 0 !important;
    }
    .modal-body .form-group label {
        margin-bottom: 2px !important;
        font-size: 11px !important;
    }
    .modal-body .form-group input,
    .modal-body .form-group select,
    .modal-body .form-group textarea {
        padding: 8px 10px !important;
        font-size: 12.5px !important;
    }
    .modal-footer {
        padding: 10px 16px !important;
        flex-shrink: 0 !important;
        border-top: 1px solid rgba(255, 255, 255, 0.06) !important;
        background: rgba(0, 0, 0, 0.15) !important;
    }
    .client-meta-section {
        grid-template-columns: 1fr !important;
        gap: 10px !important;
    }
    .client-meta-section > div {
        grid-column: span 1 !important;
    }
    .case-info-summary {
        grid-template-columns: 1fr !important;
        gap: 10px !important;
    }
    .filter-drawer {
        width: 100% !important;
        right: -100%;
    }
    .filter-drawer.open {
        right: 0;
    }
    /* Floating action button on mobile */
    .mobile-floating-add-btn {
        display: flex !important;
        position: fixed !important;
        bottom: calc(75px + env(safe-area-inset-bottom, 0px)) !important; /* Sits completely above bottom navigation bar */
        right: 16px !important;
        width: 48px !important;
        height: 48px !important;
        border-radius: 50% !important;
        background: linear-gradient(135deg, var(--color-primary), var(--color-primary-hover)) !important;
        color: #fff !important;
        border: 1px solid rgba(255, 255, 255, 0.2) !important;
        box-shadow: 0 6px 20px rgba(92, 94, 250, 0.5) !important;
        z-index: 10005 !important; /* Always sits above bottom nav bar (z-index: 9999) */
        align-items: center !important;
        justify-content: center !important;
        font-size: 20px !important;
        cursor: pointer !important;
        transition: transform 0.2s ease, box-shadow 0.2s ease !important;
    }
    .mobile-floating-add-btn:active {
        transform: scale(0.92) !important;
    }
    
    /* Hide floating add button on Cookie Asistan tab */
    body.tab-asistan #mobile-floating-add-btn,
    body.tab-asistan .mobile-floating-add-btn {
        display: none !important;
    }
}
/* Chat Session Styling */
.chat-session-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 12px;
    background: rgba(255,255,255,0.02);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    cursor: pointer;
    transition: var(--transition-smooth);
    color: var(--text-main);
    font-size: 12px;
}
.chat-session-item:hover, .chat-session-item.active {
    background: rgba(167, 139, 250, 0.08);
    border-color: var(--color-primary);
    color: var(--text-highlight);
}
.chat-session-item .session-title {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    margin-right: 8px;
    text-align: left;
}
.chat-session-item .delete-btn {
    opacity: 0.6;
    transition: opacity 0.2s ease;
    color: var(--color-danger);
    cursor: pointer;
    font-size: 11px;
    background: none;
    border: none;
    padding: 2px 6px;
}
.chat-session-item:hover .delete-btn {
    opacity: 1;
}
/* --- FILTER DRAWER & BACKDROP STYLE --- */
.filter-toggle-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-color);
    color: var(--text-main);
    padding: 0 16px;
    height: 38px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}
.filter-toggle-btn:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: var(--color-primary);
    color: var(--text-highlight);
    box-shadow: 0 0 12px rgba(99, 102, 241, 0.25);
}
.filter-drawer {
    position: fixed;
    top: 0;
    right: -340px;
    width: 340px;
    height: 100vh;
    background: rgba(11, 15, 26, 0.94);
    backdrop-filter: blur(25px);
    -webkit-backdrop-filter: blur(25px);
    border-left: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: -10px 0 35px rgba(0, 0, 0, 0.6);
    z-index: 9995;
    display: flex;
    flex-direction: column;
    visibility: hidden;
    transition: right 0.3s cubic-bezier(0.4, 0, 0.2, 1), visibility 0.3s;
}
.filter-drawer.open {
    right: 0;
    visibility: visible;
}
.filter-drawer-header {
    padding: 20px 24px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.filter-drawer-header h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    color: var(--text-highlight);
    display: flex;
    align-items: center;
    gap: 8px;
}
.close-drawer-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 18px;
    cursor: pointer;
    transition: color 0.2s;
}
.close-drawer-btn:hover {
    color: var(--color-danger);
}
.filter-drawer-body {
    padding: 24px;
    flex-grow: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 20px;
}
.drawer-filter-group {
    display: flex;
    flex-direction: column;
    gap: 16px;
}
.filter-drawer-body label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
    margin-bottom: 8px;
}
.filter-drawer-body select {
    width: 100%;
    height: 38px;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 8px;
    color: var(--text-main);
    padding: 0 12px;
    font-size: 13px;
    cursor: pointer;
    outline: none;
    transition: border-color 0.2s;
}
.filter-drawer-body select:focus {
    border-color: var(--color-primary);
}
.filter-drawer-footer {
    padding: 20px 24px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}
.filter-drawer-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.55);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    z-index: 9994;
    display: none;
    opacity: 0;
    transition: opacity 0.3s ease;
}
.filter-drawer-backdrop.open {
    display: block;
    opacity: 1;
}

/* --- TABLE HEADER SORT STYLING --- */
.data-table th.sortable {
    cursor: pointer;
    user-select: none;
    transition: background-color 0.2s ease, color 0.2s ease;
    position: relative;
    padding-right: 24px !important;
}
.data-table th.sortable:hover {
    background-color: rgba(255, 255, 255, 0.03);
    color: var(--text-highlight);
}
.sort-icon {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 10px;
    opacity: 0.25;
    transition: opacity 0.2s, color 0.2s;
}
.data-table th.sortable:hover .sort-icon {
    opacity: 0.6;
}
.data-table th.sort-asc .sort-icon,
.data-table th.sort-desc .sort-icon {
    opacity: 1;
    color: var(--color-primary);
}

/* --- MOBILE COLLAPSIBLE FILTERS & FORMS & CHAT --- */
@media (max-width: 768px) {
    html, body {
        width: 100% !important;
        height: 100% !important;
        overflow-x: hidden !important;
    }

    .app-container {
        width: 100% !important;
        height: 100% !important;
        overflow-x: hidden !important;
    }

    /* Sabit yükseklikli kabuk: kendisi scroll yapmaz, sadece top bar + content-body'yi dikey olarak sıralar */
    .main-content {
        width: 100% !important;
        height: 100vh !important;
        height: 100dvh !important;
        max-height: 100dvh !important;
        overflow: hidden !important;
    }
    
    .content-header {
        flex-shrink: 0 !important;
        padding: 12px 14px !important;
        width: 100% !important;
        box-sizing: border-box !important;
    }

    /* Hide top header/filter add buttons on mobile because mobile floating add button is present */
    .content-header .header-right,
    .content-header #btn-quick-action,
    #tab-muvekkiller .filter-bar .btn-primary,
    #tab-davalar .filter-bar .btn-primary,
    #tab-dosyalar .explorer-header #btn-file-upload-explorer,
    #tab-dosyalar .explorer-header #btn-sync-folders {
        display: none !important;
    }

    /* Collapsible states on mobile */
    .mobile-collapsed {
        display: none !important;
    }

    /* Expandable filter bars on mobile when uncollapsed */
    #tab-muvekkiller .filter-bar:not(.mobile-collapsed),
    #tab-davalar .filter-bar:not(.mobile-collapsed) {
        display: flex !important;
        flex-direction: column !important;
        align-items: stretch !important;
        gap: 10px !important;
        margin-top: 8px !important;
        margin-bottom: 12px !important;
        padding: 12px !important;
        background: rgba(15, 23, 42, 0.95) !important;
        border: 1px solid var(--border-color) !important;
        border-radius: 12px !important;
        width: 100% !important;
    }

    /* Explorer header mobile expansion when uncollapsed */
    #tab-dosyalar .explorer-header:not(.mobile-collapsed) {
        display: flex !important;
        flex-direction: column !important;
        align-items: stretch !important;
        gap: 10px !important;
        margin-top: 8px !important;
        padding: 12px !important;
        margin-bottom: 12px !important;
        background: rgba(15, 23, 42, 0.95) !important;
        border: 1px solid var(--border-color) !important;
        border-radius: 12px !important;
        width: 100% !important;
    }

    /* Stemless arrow button next to page title */
    .btn-stemless-arrow {
        align-items: center;
        justify-content: center;
        background: none;
        border: none;
        color: var(--text-muted);
        font-size: 16px;
        padding: 6px;
        cursor: pointer;
        transition: transform 0.3s ease, color 0.3s ease;
        border-radius: 50%;
        width: 32px;
        height: 32px;
        margin-left: 6px;
    }

    body.tab-pano #mobile-toggle-filter-btn,
    body.tab-dashboard #mobile-toggle-filter-btn,
    body.tab-takvim #mobile-toggle-filter-btn {
        display: none !important;
    }

    .btn-stemless-arrow:hover {
        color: var(--text-highlight) !important;
        background: rgba(255, 255, 255, 0.05) !important;
    }
    .btn-stemless-arrow.open {
        transform: rotate(180deg) !important;
        color: var(--color-primary) !important;
    }



    /* Tek scroll sahibi: top bar ile bottom nav arasındaki tüm alanı kaplar, taşan içerik burada kayar */
    .content-body {
        flex: 1 1 0 !important;
        display: flex !important;
        flex-direction: column !important;
        overflow-y: auto !important;
        overflow-x: hidden !important;
        min-height: 0 !important;
        padding: 12px 8px calc(65px + env(safe-area-inset-bottom, 0px)) 8px !important; /* ferah, geniş görünüm */
        padding-bottom: 95px !important;
        width: 100% !important;
        box-sizing: border-box !important;
        -webkit-overflow-scrolling: touch;
    }
    
    /* Sekmeler geniş kavisli alanı kaplar */
    .tab-content {
        flex: 1 1 auto !important;
        display: none;
        flex-direction: column !important;
        min-height: 0 !important;
        width: 100% !important;
        max-width: 100% !important;
        padding: 0 !important;
        margin: 0 !important;
    }
    
    .tab-content.active {
        display: flex !important;
    }
    
    /* Table Container is scrollable vertical & horizontal */
    .table-container {
        flex: 1 1 auto !important;
        overflow-y: auto !important;
        overflow-x: auto !important;
        margin: 6px 0 16px 0 !important;
        padding: 0 !important;
        width: 100% !important;
        -webkit-overflow-scrolling: touch;
        min-height: 250px !important;
        /* Edge glow hints that the table (Durum / İşlemler columns etc.) scrolls horizontally;
           a dark shadow is invisible on this near-black theme, so use a light accent glow instead.
           The opaque local-attached layers cover the glow once scrolled flush to that edge. */
        background-image:
            linear-gradient(to right, #121a2e, rgba(18, 26, 46, 0)),
            linear-gradient(to left, #121a2e, rgba(18, 26, 46, 0)),
            radial-gradient(farthest-side at 0 50%, rgba(92, 94, 250, 0.55), transparent),
            radial-gradient(farthest-side at 100% 50%, rgba(92, 94, 250, 0.55), transparent) !important;
        background-position: left, right, left, right !important;
        background-size: 24px 100%, 24px 100%, 8px 100%, 8px 100% !important;
        background-repeat: no-repeat !important;
        background-attachment: local, local, scroll, scroll !important;
    }
    /* File Explorer Container (Evraklar Tab) */
    .file-explorer-container {
        flex: 1 1 auto !important;
        height: 100% !important;
        display: flex !important;
        flex-direction: column !important;
        padding: 6px 0 16px 0 !important;
        width: 100% !important;
        overflow: hidden !important;
        gap: 10px !important;
    }

        /* Explorer Header inside files tab */
    #tab-dosyalar .explorer-header {
        flex-shrink: 0 !important;
    }
    
    #tab-dosyalar .explorer-header button#btn-sync-folders,
    #tab-dosyalar .explorer-header button#btn-file-upload-explorer {
        display: none !important; /* Hide admin-only/sync buttons in the explorer header on mobile to prevent stretching */
    }
    .file-grid-layout {
        flex: 1 1 auto !important;
        overflow: hidden !important;
        min-height: 0 !important;
        display: flex !important;
        flex-direction: column !important;
    }
    .file-list-view {
        flex: 1 1 auto !important;
        height: 100% !important;
        min-height: 0 !important;
        display: flex !important;
        flex-direction: column !important;
        overflow: hidden !important;
    }
    .file-items-list {
        flex: 1 1 auto !important;
        overflow-y: auto !important;
        min-height: 0 !important;
        -webkit-overflow-scrolling: touch;
    }
    /* Hide desktop add buttons in filters on mobile */
    #tab-muvekkiller .filter-bar .btn-primary,
    #tab-davalar .filter-bar .btn-primary {
        display: none !important;
    }
    /* Collapsible states */
    .mobile-collapsed {
        display: none !important;
    }
/* Expandable filter bars */
    #tab-muvekkiller .filter-bar:not(.mobile-collapsed),
    #tab-davalar .filter-bar:not(.mobile-collapsed) {
        display: flex !important;
        flex-direction: column !important;
        align-items: stretch !important;
        gap: 10px !important;
        margin-top: 8px !important; /* tiny space below top bar */
        margin-bottom: 12px !important;
        padding: 0 16px 12px 16px !important;
    }
    /* Explorer header mobile expansion */
    #tab-dosyalar .explorer-header:not(.mobile-collapsed) {
        display: flex !important;
        flex-direction: column !important;
        align-items: stretch !important;
        gap: 10px !important;
        margin-top: 8px !important; /* tiny space below top bar */
        padding: 12px !important;
        margin-bottom: 12px !important;
    }
    #tab-dosyalar .explorer-header .search-input-wrapper {
        width: 100% !important;
    }
    #tab-dosyalar .explorer-header button {
        width: 100% !important;
        justify-content: center !important;
    }
    /* Calendar sidebar mobile expansion */
    .calendar-layout {
        display: flex !important;
        flex-direction: column !important;
        height: 100% !important;
        overflow: hidden !important;
        gap: 15px !important;
        padding: 10px 20px 20px 20px !important; /* Centered with 20px padding matching other tabs, plus 10px top spacing */
    }
    .calendar-sidebar {
        display: none !important; /* Hidden inline on mobile */
    }
    #hearing-modal-overlay {
        display: none !important;
    }
    #hearing-modal-overlay.active {
        display: flex !important;
        position: fixed !important;
        top: 0 !important;
        left: 0 !important;
        width: 100vw !important;
        height: 100dvh !important;
        background: rgba(0, 0, 0, 0.75) !important;
        z-index: 12000 !important;
        justify-content: center !important;
        align-items: flex-end !important; /* Bottom-sheet */
        opacity: 1 !important;
        pointer-events: all !important;
    }
    #hearing-modal-overlay.active .calendar-sidebar {
        display: flex !important;
        flex-direction: column !important;
        width: 100% !important;
        max-width: 500px !important;
        max-height: 80dvh !important; /* safer dynamic viewport height */
        border-radius: 24px 24px 0 0 !important;
        padding: 0 !important; /* reset padding to dock header and body */
        background: #110d26 !important;
        border: 1px solid rgba(255, 255, 255, 0.08) !important;
        border-bottom: none !important;
        box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.5) !important;
        transform: translateY(0) !important;
        animation: slideUp 0.3s ease-out !important;
        overflow: hidden !important;
    }
    #hearing-modal-overlay .modal-header {
        padding: 12px 20px 12px 20px !important;
        border-bottom: 1px solid rgba(255, 255, 255, 0.06) !important;
        margin-bottom: 0 !important;
    }
    #hearing-modal-overlay.active .calendar-sidebar form {
        display: flex !important;
        flex-direction: column !important;
        flex: 1 1 auto !important;
        overflow-y: auto !important;
        padding: 12px 16px !important;
        gap: 10px !important;
        min-height: 0 !important;
        -webkit-overflow-scrolling: touch;
    }
    .calendar-main {
        flex: 1 1 auto !important;
        display: flex !important;
        flex-direction: column !important;
        overflow: hidden !important;
        min-height: 0 !important;
    }
    #calendar-timeline {
        flex: 1 1 auto !important;
        overflow-y: auto !important;
        min-height: 0 !important;
    }

    /* Stemless arrow button next to page title */
    .btn-stemless-arrow {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        background: none;
        border: none;
        color: var(--text-muted);
        font-size: 16px;
        padding: 6px;
        cursor: pointer;
        transition: transform 0.3s ease, color 0.3s ease;
        border-radius: 50%;
        width: 32px;
        height: 32px;
    }
    .btn-stemless-arrow:hover {
        color: var(--text-highlight);
        background: rgba(255, 255, 255, 0.05);
    }
    .btn-stemless-arrow.open {
        transform: rotate(180deg);
        color: var(--color-primary);
    }
    /* AI Asistan Mobile Scale & Fit */
    #tab-asistan {
        height: 100% !important;
        margin: 0 !important;
        padding: 0 !important;
    }
    .chat-layout-wrapper {
        height: 100% !important;
        padding: 0 10px 10px 10px !important;
        gap: 0 !important;
    }
    .asistan-chat-container {
        height: 100% !important;
        border-radius: 8px !important;
        margin: 0 !important;
    }
    .chat-input-area {
        padding: 10px 12px !important;
    }
    .chat-messages {
        padding: 12px !important;
        gap: 12px !important;
    }
    .chat-header {
        padding: 10px 12px !important;
        flex-wrap: wrap !important;
        gap: 8px !important;
    }
    .chat-header > div {
        flex-wrap: wrap !important;
    }
    /* Action buttons go icon-only on mobile so they fit on one row instead of
       wrapping to a second line and eating vertical space above the chat. */
    .chat-header .btn .btn-label {
        display: none !important;
    }
    .chat-header .btn {
        padding: 8px 10px !important;
        width: 32px !important;
        justify-content: center !important;
    }
    .message {
        max-width: 90% !important;
    }

    .mobile-single-col {
        grid-template-columns: 1fr !important;
    }
   /* Side-by-side Dashboard sections on Mobile (Dynamically Sized) */
    #tab-pano {
        display: none;
        height: 100% !important;
        flex-direction: column !important;
        overflow: hidden !important;
        min-height: 0 !important;
    }
    #tab-pano.active {
        display: flex !important;
    }
    #tab-pano .stats-grid {
        display: grid !important;
        grid-template-columns: 1fr 1fr !important; /* Exactly two columns matching dashboard-sections */
        gap: 8px !important;
        padding: 10px 10px 0 10px !important;
        flex-shrink: 0 !important;
        margin-bottom: 8px !important;
    }
    #tab-pano .stats-grid .stat-card {
        padding: 8px 12px !important;
        gap: 10px !important;
        align-items: center !important;
        flex-direction: row !important;
        min-width: 0 !important;
        border-radius: 10px !important;
    }
    #tab-pano .stats-grid .stat-icon-wrapper {
        width: 32px !important;
        height: 32px !important;
        font-size: 14px !important;
        border-radius: 8px !important;
        flex-shrink: 0 !important;
    }
    #tab-pano .stats-grid .stat-data {
        min-width: 0 !important;
        flex: 1 !important;
    }
    #tab-pano .stats-grid .stat-val {
        font-size: 16px !important;
        line-height: 1.1 !important;
    }
    #tab-pano .stats-grid .stat-lbl {
        font-size: 10px !important;
        line-height: 1.1 !important;
        white-space: nowrap !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
        display: block !important;
    }
    #tab-pano .dashboard-sections {
        flex: 1 1 auto !important;
        display: grid !important;
        grid-template-columns: 1fr 1fr !important; /* Force side-by-side */
        gap: 8px !important;
        padding: 0 10px 10px 10px !important;
        width: 100% !important;
        max-width: 100% !important;
        box-sizing: border-box !important;
        height: 100% !important;
        min-height: 0 !important;
        overflow: hidden !important;
    }
    #tab-pano .section-column {
        min-width: 0 !important;
        width: 100% !important;
        overflow: hidden !important;
        height: 100% !important;
        min-height: 0 !important;
        display: flex !important;
        flex-direction: column !important;
    }
    #tab-pano .content-card {
        min-width: 0 !important;
        width: 100% !important;
        flex: 1 1 auto !important;
        height: 100% !important; /* Dynamically stretch to fill space */
        min-height: 0 !important;
        overflow: hidden !important;
        display: flex !important;
        flex-direction: column !important;
    }
    .card-header {
        padding: 10px 12px !important;
        flex-shrink: 0 !important;
    }
    #tab-pano .card-header h3 {
        font-size: 11px !important; /* Smaller titles to fit, allowed to wrap instead of clipping mid-word */
        white-space: normal !important;
        line-height: 1.3 !important;
        overflow: visible !important;
        text-overflow: clip !important;
    }
        .card-body {
        padding: 8px !important;
        overflow-y: auto !important;
        overflow-x: hidden !important;
        flex: 1 1 auto !important;
        min-width: 0 !important;
        width: 100% !important;
    }
    .timeline-list, .file-quick-list {
        min-width: 0 !important;
        width: 100% !important;
        overflow: hidden !important;
    }
    /* Compact Timeline Items for Side-by-side View */
    #tab-pano .timeline-item {
        padding: 8px !important;
        gap: 8px !important;
        min-width: 0 !important;
        width: 100% !important;
        box-sizing: border-box !important;
        overflow: hidden !important;
    }
    #tab-pano .timeline-item:has(.timeline-date-box) {
        flex-direction: column !important;
        align-items: stretch !important;
    }
    .timeline-date-box {
        width: 100% !important;
        flex-direction: row !important;
        justify-content: flex-start !important;
        align-items: center !important;
        gap: 6px !important;
        padding: 4px 8px !important;
        height: auto !important;
        background: rgba(92, 94, 250, 0.1) !important;
        border: 1px solid rgba(92, 94, 250, 0.2) !important;
        border-radius: 6px !important;
        flex-shrink: 0 !important;
    }
    .timeline-day {
        font-size: 11px !important;
        font-weight: 700 !important;
        margin: 0 !important;
    }
    .timeline-month {
        font-size: 8px !important;
        text-transform: uppercase !important;
        margin: 0 !important;
    }
    .timeline-info {
        margin: 0 !important;
        min-width: 0 !important; /* Prevent text stretch */
        width: 100% !important;
        overflow: hidden !important;
    }
    #tab-pano .timeline-title {
        font-size: 11px !important;
        line-height: 1.3 !important;
        white-space: nowrap !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
        display: block !important;
        width: 100% !important;
    }
    #tab-pano .timeline-meta {
        font-size: 9px !important;
        margin-top: 4px !important;
        white-space: nowrap !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
        display: block !important;
        width: 100% !important;
    }
    #tab-pano .timeline-item:has(.timeline-date-box) > div[style*="display: flex"] {
        justify-content: space-between !important;
        margin-top: 6px !important;
        border-top: 1px solid rgba(255, 255, 255, 0.05) !important;
        padding-top: 6px !important;
        flex-shrink: 0 !important;
        min-width: 0 !important;
        width: 100% !important;
        overflow: hidden !important;
    }
    .timeline-type-badge {
        padding: 2px 4px !important;
        font-size: 8px !important;
        white-space: nowrap !important;
    }
    .timeline-complete-btn {
        font-size: 13px !important;
        flex-shrink: 0 !important;
    }
.file-quick-list .stat-icon-wrapper {
        width: 28px !important;
        height: 28px !important;
        font-size: 10px !important;
        border-radius: 6px !important;
        flex-shrink: 0 !important;
    }
    .file-quick-list .timeline-info {
        margin-left: 0 !important;
    }
    .mobile-single-col {
        grid-template-columns: 1fr !important;
    }
}

/* Global Hearing Modal Mode (when opened from other tabs on desktop) */
#hearing-modal-overlay.modal-mode {
    display: flex !important;
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    background: rgba(0, 0, 0, 0.6) !important;
    backdrop-filter: blur(4px) !important;
    z-index: 10010 !important; /* above the mobile FAB (10005), matching .modal-overlay */
    align-items: center !important;
    justify-content: center !important;
    opacity: 1 !important;
    pointer-events: all !important;
}
#hearing-modal-overlay.modal-mode .calendar-sidebar {
    display: flex !important;
    width: 450px !important;
    max-width: 90% !important;
    height: auto !important;
    max-height: 85vh !important;
    border-radius: 12px !important;
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37) !important;
    padding: 24px !important;
    background: #110d26 !important;
    border: 1px solid rgba(255, 255, 255, 0.08) !important;
}
#hearing-modal-overlay.modal-mode .calendar-sidebar .modal-header.mobile-only-flex {
    display: flex !important; /* show close button inside modal-mode */
}
#hearing-modal-overlay.modal-mode .calendar-sidebar .desktop-only-block {
    display: none !important; /* hide default desktop header as we show modal-header */
}
