/* ─── Design Tokens ──────────────────────────────────────────── */
:root {
    --body-bg:       #cbd5e1;
    --bg:            #f4f5f7;
    --surface:       #ffffff;
    --surface-2:     #f8fafc;
    --border:        #e2e8f0;
    --border-focus:  #94a3b8;

    --text-1:        #0f172a;
    --text-2:        #475569;
    --text-3:        #94a3b8;

    --accent:        #0f172a;
    --accent-light:  rgba(15, 23, 42, 0.05);
    --accent-hover:  #1e293b;

    --blue:          #3b82f6;
    --green:         #10b981;
    --red:           #ef4444;
    --danger:        #ef4444;
    --amber:         #f59e0b;

    --sidebar-w:     260px;
    --header-h:      64px;
    --r-sm:          6px;
    --r-md:          10px;
    --r-lg:          16px;

    --shadow-sm:     0 1px 3px rgba(0,0,0,0.05), 0 1px 2px rgba(0,0,0,0.03);
    --shadow-md:     0 4px 16px rgba(0,0,0,0.06);
    --shadow-lg:     0 20px 40px -10px rgba(15, 23, 42, 0.15);

    --ease:          cubic-bezier(0.4, 0, 0.2, 1);
    --dur:           0.2s;
}

/* ─── Reset ──────────────────────────────────────────────────── */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
body { 
    font-family: 'DM Sans', sans-serif; 
    font-size: 14px; 
    background: var(--body-bg); 
    color: var(--text-1); 
    overflow: hidden; 
    -webkit-font-smoothing: antialiased; 
    display: flex; align-items: center; justify-content: center;
    height: 100dvh; width: 100vw;
}
#wpadminbar { display: none !important; }
html, * html body { margin-top: 0 !important; }
a { text-decoration: none; color: inherit; }
button { font-family: inherit; cursor: pointer; border: none; background: none; }
input, textarea { font-family: inherit; }
svg { display: block; }

/* ─── Layout (Konteyner Yapısı) ──────────────────────────────── */
.app { 
    display: flex; width: calc(100vw - 48px); height: calc(100dvh - 48px); max-width: 1600px;
    background: var(--surface); border-radius: 24px; 
    box-shadow: var(--shadow-lg), 0 0 0 1px rgba(15,23,42, 0.05); overflow: hidden; 
}

/* ─── Sidebar ────────────────────────────────────────────────── */
.sidebar {
    width: var(--sidebar-w); min-width: var(--sidebar-w);
    background: var(--surface); border-right: 1px solid var(--border);
    display: flex; flex-direction: column; overflow: hidden;
    transition: transform var(--dur) var(--ease); z-index: 200;
}
.sidebar-logo { display: flex; align-items: center; gap: 12px; padding: 24px 24px 16px; border-bottom: 1px solid var(--border); }
.logo-mark { width: 36px; height: 36px; background: var(--accent); border-radius: var(--r-md); display: grid; place-items: center; color: #fff; font-family: 'DM Mono', monospace; font-size: 15px; font-weight: 500; flex-shrink: 0; overflow: hidden; }
.logo-text { display: flex; flex-direction: column; gap: 2px; }
.logo-name { font-size: 14px; font-weight: 700; color: var(--text-1); white-space: nowrap; }
.logo-sub { font-size: 10px; font-weight: 600; color: var(--text-3); letter-spacing: 0.05em; text-transform: uppercase; }

/* Nav */
.nav-wrap { flex: 1; overflow-y: auto; padding: 16px 0; }
.nav-wrap::-webkit-scrollbar { width: 4px; }
.nav-wrap::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; }
.nav-group { margin-bottom: 8px; }
.nav-group-label { padding: 12px 24px 8px; font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.1em; color: var(--text-3); }
.nav-item {
    display: flex; align-items: center; gap: 12px; padding: 10px 14px 10px 18px; margin: 2px 12px;
    border-radius: var(--r-md); color: var(--text-2); font-size: 13.5px; font-weight: 500; cursor: pointer;
    transition: all var(--dur) var(--ease); user-select: none;
}
.nav-item svg { width: 18px; height: 18px; flex-shrink: 0; opacity: 0.7; }
.nav-item:hover { background: var(--surface-2); color: var(--text-1); }
.nav-item.active { background: var(--accent); color: #fff; font-weight: 600; box-shadow: 0 4px 12px rgba(15,23,42,0.15); }
.nav-item.active svg { opacity: 1; }
.nav-badge { margin-left: auto; background: var(--blue); color: #fff; font-size: 10px; font-weight: 700; padding: 2px 6px; border-radius: 12px; min-width: 20px; text-align: center; }

/* Sidebar Footer */
.sidebar-footer { padding: 16px; border-top: 1px solid var(--border); }
.user-card { display: flex; align-items: center; gap: 12px; padding: 8px; border-radius: var(--r-md); transition: background var(--dur); }
.user-card:hover { background: var(--surface-2); }
.user-avatar { width: 36px; height: 36px; border-radius: var(--r-sm); background: var(--accent); color: #fff; font-weight: 700; font-size: 13px; display: grid; place-items: center; overflow: hidden; flex-shrink: 0; }
.user-avatar img { width: 100%; height: 100%; object-fit: cover; }
.user-meta { flex: 1; min-width: 0; }
.user-name { font-size: 13px; font-weight: 600; color: var(--text-1); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-role { font-size: 11px; color: var(--text-3); font-weight: 500; }
.logout-btn { width: 32px; height: 32px; display: grid; place-items: center; border-radius: var(--r-sm); color: var(--text-3); transition: all var(--dur); }
.logout-btn:hover { background: #fef2f2; color: var(--red); }

/* ─── Mobile Overlay ────────────────────────────────────────────── */
.overlay { display: none; position: fixed; inset: 0; background: rgba(15,23,42,0.4); z-index: 199; opacity: 0; transition: opacity 0.3s var(--ease); backdrop-filter: blur(2px); }
.overlay.show { opacity: 1; pointer-events: all; }

/* ─── Main Content ───────────────────────────────────────────────── */
.main { flex: 1; display: flex; flex-direction: column; overflow: hidden; min-width: 0; position: relative; }

/* Topbar */
.topbar { height: var(--header-h); min-height: var(--header-h); background: var(--surface); border-bottom: 1px solid var(--border); display: flex; align-items: center; padding: 0 24px; gap: 16px; }
.hamburger { 
    display: none; 
    width: 44px; 
    height: 44px; 
    border-radius: var(--r-md); 
    align-items: center; 
    justify-content: center; 
    color: var(--text-2); 
    transition: all var(--dur); 
    border: 1px solid var(--border);
    background: var(--surface);
    padding: 0;
    cursor: pointer;
    overflow: hidden;
}
.hamburger:hover { background: var(--surface-2); border-color: var(--border-focus); color: var(--text-1); }

/* Animated Menu Icon */
.menu-toggle-icon {
    width: 32px;
    height: 32px;
    transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}
.hamburger.open .menu-toggle-icon { transform: rotate(-45deg); }

.menu-path {
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    stroke-dasharray: 12 63;
}
.hamburger.open .menu-path {
    stroke-dasharray: 20 300;
    stroke-dashoffset: -32.42px;
}
.view-title { font-size: 16px; font-weight: 700; flex: 1; color: var(--text-1); }
.search-wrap { position: relative; display: flex; align-items: center; }
.search-wrap svg { position: absolute; left: 12px; color: var(--text-3); width: 16px; height: 16px; pointer-events: none; }
.search-input { width: 240px; height: 38px; padding: 0 14px 0 36px; border: 1px solid var(--border); border-radius: var(--r-md); font-size: 13px; color: var(--text-1); background: var(--surface-2); outline: none; transition: all var(--dur); }
.search-input:focus { border-color: var(--blue); background: var(--surface); box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1); }
.topbar-avatar { width: 34px; height: 34px; border-radius: var(--r-md); overflow: hidden; background: var(--accent); color: #fff; font-size: 12px; font-weight: 700; display: grid; place-items: center; flex-shrink: 0; }
.topbar-avatar img { width: 100%; height: 100%; object-fit: cover; }

/* Toast Notifications */
.toast-container { position: fixed; top: 32px; right: 32px; z-index: 9999; display: flex; flex-direction: column; gap: 10px; pointer-events: none; }
.toast { display: flex; align-items: center; gap: 12px; padding: 14px 18px; border-radius: var(--r-md); background: var(--surface); box-shadow: var(--shadow-lg); border-left: 4px solid; font-size: 13.5px; font-weight: 600; color: var(--text-1); pointer-events: auto; animation: toastSlideIn 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards; max-width: 350px; }
.toast.success { border-left-color: var(--green); }
.toast.error { border-left-color: var(--red); }
.toast.fade-out { animation: toastFadeOut 0.3s forwards; }
.toast svg { width: 18px; height: 18px; flex-shrink: 0; }
.toast.success svg { color: var(--green); }
.toast.error svg { color: var(--red); }
@keyframes toastSlideIn { from { transform: translateX(100%); opacity: 0; } to { transform: translateX(0); opacity: 1; } }
@keyframes toastFadeOut { from { transform: translateX(0); opacity: 1; } to { transform: translateX(100%); opacity: 0; } }

/* ─── Content Area ───────────────────────────────────────────────── */
.content-area { flex: 1; display: flex; overflow: hidden; position: relative; }

/* ─── Emails View ────────────────────────────────────────────────── */
#emailsView { display: flex; width: 100%; background: var(--surface); overflow: hidden; }
#emailsView.hidden { display: none; }

.list-col { width: 360px; min-width: 360px; display: flex; flex-direction: column; border-right: 1px solid var(--border); background: var(--surface-2); }
.list-toolbar { display: flex; align-items: center; gap: 8px; padding: 12px 16px; border-bottom: 1px solid var(--border); background: var(--surface); }
.filter-btn { padding: 6px 14px; border-radius: 20px; border: 1px solid var(--border); font-size: 12px; font-weight: 600; color: var(--text-2); background: var(--surface); transition: all var(--dur); cursor: pointer; }
.filter-btn:hover { background: var(--surface-2); color: var(--text-1); }
.filter-btn.active { background: var(--accent); color: #fff; border-color: var(--accent); }
.refresh-btn { margin-left: auto; width: 32px; height: 32px; border-radius: var(--r-md); border: 1px solid var(--border); display: grid; place-items: center; color: var(--text-2); background: var(--surface); transition: all var(--dur); cursor: pointer; }
.refresh-btn:hover { background: var(--surface-2); color: var(--text-1); }
.refresh-btn.spinning svg { animation: spin 0.8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.email-list { flex: 1; overflow-y: auto; }
.email-list::-webkit-scrollbar { width: 4px; }
.email-list::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; }
.email-row { display: flex; gap: 14px; align-items: flex-start; padding: 16px; border-bottom: 1px solid var(--border); cursor: pointer; transition: background var(--dur); position: relative; background: var(--surface); }
.email-row:hover { background: var(--surface-2); }
.email-row.is-active { background: #eff6ff; border-left: 3px solid var(--blue); padding-left: 13px; }
.email-row-avatar { width: 40px; height: 40px; border-radius: 50%; background: #e2e8f0; color: var(--text-2); font-weight: 700; font-size: 14px; display: grid; place-items: center; flex-shrink: 0; overflow: hidden; }
.email-row-body { flex: 1; min-width: 0; }
.email-row-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 4px; }
.email-row-sender { font-size: 13.5px; font-weight: 600; color: var(--text-1); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.email-row-time { font-size: 11px; color: var(--text-3); font-weight: 500; }
.email-row-subject { font-size: 13px; font-weight: 500; color: var(--text-1); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-bottom: 4px; }
.email-row-snippet { font-size: 12.5px; color: var(--text-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.email-row.is-unread .email-row-sender, .email-row.is-unread .email-row-subject { font-weight: 700; color: var(--text-1); }
.unread-dot { position: absolute; right: 16px; top: 50%; transform: translateY(-50%); width: 8px; height: 8px; border-radius: 50%; background: var(--blue); box-shadow: 0 0 0 3px #eff6ff; }

.skeleton-row { display: flex; gap: 14px; padding: 16px; border-bottom: 1px solid var(--border); background: var(--surface); }
.skel { background: linear-gradient(90deg, #e2e8f0 25%, #f1f5f9 50%, #e2e8f0 75%); background-size: 200% 100%; animation: shimmer 1.5s infinite; border-radius: 4px; }
.skel-avatar { width: 40px; height: 40px; border-radius: 50%; flex-shrink: 0; }
.skel-body { flex: 1; display: flex; flex-direction: column; gap: 8px; padding-top: 4px; }
.skel-line-1 { height: 12px; width: 50%; }
.skel-line-2 { height: 12px; width: 80%; }
.skel-line-3 { height: 10px; width: 40%; }
@keyframes shimmer { to { background-position: -200% 0; } }

.list-empty { padding: 48px 24px; text-align: center; color: var(--text-3); }
.list-empty svg { width: 40px; height: 40px; margin: 0 auto 12px; opacity: 0.5; }
.list-empty p { font-size: 13.5px; font-weight: 500; }

.list-footer { padding: 12px 16px; border-top: 1px solid var(--border); display: flex; flex-direction: column; gap: 8px; background: var(--surface); }
.storage-bar { height: 6px; background: var(--surface-2); border-radius: 3px; overflow: hidden; border: 1px solid var(--border); }
.storage-fill { height: 100%; background: var(--green); border-radius: 3px; width: 0%; transition: width 0.5s var(--ease); }
.list-meta { display: flex; justify-content: space-between; font-size: 11px; font-weight: 600; color: var(--text-3); }

/* Detail Column */
.detail-col { flex: 1; display: flex; flex-direction: column; overflow: hidden; background: var(--bg); }
.detail-empty { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 16px; color: var(--text-3); background: var(--surface-2); }
.detail-empty svg { width: 56px; height: 56px; opacity: 0.2; }
.detail-empty p { font-size: 14px; font-weight: 600; }
.detail-content { flex: 1; display: flex; flex-direction: column; overflow: hidden; }
.detail-content.hidden { display: none; }
.detail-topbar { height: 64px; min-height: 64px; display: flex; align-items: center; justify-content: space-between; padding: 0 24px; background: var(--surface); border-bottom: 1px solid var(--border); flex-shrink: 0;}
.detail-topbar-left { display: flex; align-items: center; gap: 12px; }
.back-btn { display: none; width: 36px; height: 36px; border-radius: var(--r-md); align-items: center; justify-content: center; color: var(--text-2); border: 1px solid var(--border); transition: all var(--dur); cursor: pointer; }
.back-btn:hover { background: var(--surface-2); color: var(--text-1); }
.detail-thread-title { font-size: 15px; font-weight: 700; color: var(--text-1); }
.detail-action-row { display: flex; gap: 8px; }
.icon-btn { width: 36px; height: 36px; border-radius: var(--r-md); display: grid; place-items: center; color: var(--text-2); border: 1px solid transparent; transition: all var(--dur); background: var(--surface-2); cursor: pointer; }
.icon-btn:hover { background: var(--surface); border-color: var(--border); color: var(--text-1); box-shadow: var(--shadow-sm); }
.icon-btn.danger:hover { background: #fef2f2; border-color: #fecaca; color: var(--red); }

.detail-body { flex: 1; overflow-y: auto; padding: 24px; display: flex; flex-direction: column; gap: 20px; }
.detail-body::-webkit-scrollbar { width: 6px; }
.detail-body::-webkit-scrollbar-thumb { background: var(--border-focus); border-radius: 6px; }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); overflow: hidden; box-shadow: var(--shadow-sm); }
.card-header { display: flex; align-items: center; gap: 10px; padding: 14px 20px; border-bottom: 1px solid var(--border); background: var(--surface-2); }
.card-header svg { width: 16px; height: 16px; color: var(--text-3); flex-shrink: 0; }
.card-header-title { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; color: var(--text-2); }
.card-body { padding: 20px; }
.info-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 20px; }
.info-cell { display: flex; flex-direction: column; gap: 6px; }
.info-label { font-size: 12px; color: var(--text-3); font-weight: 600; }
.info-val { font-size: 14px; font-weight: 600; color: var(--text-1); word-break: break-word; }
.msg-body { font-size: 14.5px; line-height: 1.8; color: var(--text-2); white-space: pre-wrap; }

/* ─── Settings Panels (Tam Genişlik Bütünleşik Tasarım) ──────── */
.panel {
    display: none; position: absolute; inset: 0; background: var(--surface-2); z-index: 100;
    flex-direction: column; overflow: hidden; animation: slideUp 0.3s var(--ease) both;
}
.panel.show { display: flex; }
.panel-form { display: flex; flex-direction: column; height: 100%; width: 100%; }

/* Panel Header */
.panel-header {
    display: flex; align-items: center; justify-content: space-between;
    padding: 24px 40px; background: var(--surface); border-bottom: 1px solid var(--border);
    flex-shrink: 0; z-index: 10;
}
.panel-title { font-size: 20px; font-weight: 700; color: var(--text-1); }
.panel-close { width: 40px; height: 40px; border-radius: var(--r-md); display: grid; place-items: center; color: var(--text-2); background: var(--surface-2); border: 1px solid transparent; transition: all var(--dur); cursor: pointer; }
.panel-close:hover { background: var(--surface); border-color: var(--border); color: var(--text-1); box-shadow: var(--shadow-sm); }

/* Panel Body (Tam Genişlik Form Alanı) */
.panel-body {
    flex: 1; overflow-y: auto; padding: 40px;
    display: flex; flex-direction: column; background: var(--surface);
}
.panel-body::-webkit-scrollbar { width: 6px; }
.panel-body::-webkit-scrollbar-thumb { background: var(--border-focus); border-radius: 6px; }

/* Bölümler */
.panel-section { margin-bottom: 48px; width: 100%; }
.panel-section:last-child { margin-bottom: 0; }
.section-title { 
    font-size: 16px; font-weight: 700; color: var(--text-1); margin-bottom: 24px; 
    padding-bottom: 12px; border-bottom: 1px solid var(--border);
    display: flex; align-items: center; gap: 10px;
}
.section-title svg { width: 20px; height: 20px; color: var(--text-3); }

/* Panel Fixed Footer (Sabit Alt Bar) */
.panel-footer {
    padding: 24px 40px; background: var(--surface); border-top: 1px solid var(--border);
    display: flex; justify-content: flex-end; align-items: center; flex-shrink: 0; z-index: 10;
    box-shadow: 0 -4px 12px rgba(0,0,0,0.02); gap: 16px;
}
.panel-footer .btn-danger-outline { margin-right: auto; }

/* Forms Elements (Responsive Grid) */
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 24px 32px; }
.form-group { display: flex; flex-direction: column; gap: 8px; }
.form-group.full { grid-column: 1 / -1; }
.form-label { font-size: 13.5px; font-weight: 600; color: var(--text-1); }
.form-control { padding: 14px 16px; border: 1px solid var(--border); border-radius: var(--r-md); font-size: 14px; color: var(--text-1); outline: none; background: var(--surface-2); transition: all var(--dur); width: 100%; }
.form-control:focus { border-color: var(--blue); background: var(--surface); box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1); }
textarea.form-control { resize: vertical; min-height: 120px; }

/* Input Group */
.input-group { display: flex; align-items: stretch; gap: 8px; width: 100%; }
.input-group .form-control { flex: 1; }
.media-picker-btn { 
    display: flex; align-items: center; gap: 8px; padding: 0 16px; 
    background: var(--surface-2); border: 1px solid var(--border); 
    border-radius: var(--r-md); font-size: 13px; font-weight: 600; 
    color: var(--text-2); transition: all var(--dur); white-space: nowrap;
}
.media-picker-btn:hover { background: var(--surface); border-color: var(--border-focus); color: var(--text-1); }
.media-picker-btn svg { width: 16px; height: 16px; opacity: 0.7; }

/* Buttons */
.btn-primary { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 14px 32px; background: var(--accent); color: #fff; border-radius: var(--r-md); font-size: 14.5px; font-weight: 600; transition: all var(--dur); box-shadow: 0 4px 12px rgba(15,23,42,0.15); cursor: pointer; border:none; }
.btn-primary:hover { background: #3b82f6; transform: translateY(-1px); }
.btn-primary-outline { background: transparent; border: 1.5px solid var(--blue); color: var(--blue); padding: 8px 16px; border-radius: 8px; font-weight: 500; cursor: pointer; transition: all 0.2s; display: flex; align-items: center; justify-content: center; gap: 8px; }
.btn-primary-outline:hover { background: rgba(59, 130, 246, 0.05); }

.btn-secondary {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    padding: 10px 20px; background: var(--surface-2); color: var(--text-2);
    border: 1px solid var(--border); border-radius: var(--r-md);
    font-size: 13px; font-weight: 600; transition: all var(--dur); cursor: pointer;
}
.btn-secondary:hover { background: var(--surface); border-color: var(--border-focus); color: var(--text-1); box-shadow: var(--shadow-sm); }
.btn-secondary svg { width: 16px; height: 16px; opacity: 0.7; }

    .profile-pic-uploader { display: flex; align-items: center; gap: 20px; padding: 15px; background: rgba(255,255,255,0.03); border: 1px dashed var(--border); border-radius: 12px; }
    .profile-pic-preview, .video-preview { width: 80px; height: 80px; border-radius: 50%; overflow: hidden; background: var(--bg-3); border: 2px solid var(--border); display: flex; align-items: center; justify-content: center; flex-shrink: 0; position: relative; }
    .video-preview { border-radius: 12px; width: 120px; }
    .profile-pic-preview img, .video-preview video { width: 100%; height: 100%; object-fit: cover; }
    .profile-pic-preview svg, .video-preview svg { width: 32px; height: 32px; color: var(--text-3); opacity: 0.5; }
    .profile-pic-info { flex: 1; }
    .profile-pic-info p { font-size: 12px; color: var(--text-3); margin-top: 4px; }

    /* Video Config Grid Styles */
    .video-config-grid {
        background: var(--surface-2) !important;
        box-shadow: var(--shadow-sm);
    }
    .video-preview-container {
        box-shadow: 0 10px 30px rgba(0,0,0,0.3);
    }
    .video-settings-col h4 {
        color: var(--accent);
        border-bottom: 2px solid var(--accent-light);
        display: inline-block;
        padding-bottom: 4px;
    }

.switch { position: relative; display: inline-block; width: 44px; height: 24px; }
.switch input { opacity: 0; width: 0; height: 0; }
.slider { position: absolute; cursor: pointer; top: 0; left: 0; right: 0; bottom: 0; background-color: var(--border); transition: .3s; border-radius: 24px; }
.slider:before { position: absolute; content: ""; height: 18px; width: 18px; left: 3px; bottom: 3px; background-color: white; transition: .3s; border-radius: 50%; }
input:checked + .slider { background-color: var(--blue); }
input:checked + .slider:before { transform: translateX(20px); }

.btn-danger-outline { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 12px 24px; background: transparent; color: var(--red); border: 1px solid #fecaca; border-radius: var(--r-md); font-size: 14px; font-weight: 600; transition: all var(--dur); cursor: pointer; }
.btn-danger-outline:hover { background: #fef2f2; border-color: var(--red); }

/* ─── Liste Görünümü (Media Layers) ────────────── */
.layer-list { display: flex; flex-direction: column; gap: 16px; width: 100%; }
.layer-card {
    display: flex; align-items: center; gap: 32px; padding: 20px 24px;
    border: 1px solid var(--border); border-radius: var(--r-md);
    background: var(--surface); transition: all var(--dur);
}
.layer-card:hover { border-color: var(--border-focus); box-shadow: var(--shadow-sm); }

.layer-preview {
    width: 140px; height: 90px; border-radius: var(--r-sm);
    background: var(--surface-2); position: relative; overflow: hidden;
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0; border: 1px solid var(--border);
}
.layer-preview.brand-preview {
    background: #000;
}
.layer-preview img { width: 100%; height: 100%; object-fit: contain; }
.layer-preview svg { width: 32px; height: 32px; color: var(--text-3); opacity: 0.5; }
.layer-badge-num {
    position: absolute; top: 6px; left: 6px; background: var(--accent); color: #fff;
    font-size: 11px; font-weight: 700; padding: 3px 8px; border-radius: 4px;
}

.layer-info { flex: 1; display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.layer-title { font-size: 15px; font-weight: 700; color: var(--text-1); display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.layer-status { font-size: 11px; font-weight: 700; padding: 4px 10px; border-radius: 12px; text-transform: uppercase; letter-spacing: 0.05em; white-space: nowrap; }
.layer-status.ok { background: #dcfce7; color: #166534; }
.layer-status.err { background: #fee2e2; color: #991b1b; }
.layer-status.warn { background: #fef3c7; color: #92400e; }
.layer-desc { font-size: 13px; color: var(--text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* Brand Item Specifics */
.brand-item-row .layer-info .form-grid {
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

@media (max-width: 640px) {
    .brand-item-row .layer-info .form-grid {
        grid-template-columns: 1fr;
    }
}

/* Butonları Sağa Yaslama */
.layer-actions { display: flex; gap: 16px; flex-shrink: 0; flex-wrap: wrap; margin-left: auto; }
.layer-btn {
    display: flex; flex-direction: column; align-items: flex-start; gap: 6px;
    padding: 10px 16px; border: 1px solid var(--border); border-radius: var(--r-md);
    background: var(--surface-2); cursor: pointer; transition: all var(--dur); min-width: 140px;
}
.layer-btn:hover { background: var(--surface); border-color: var(--blue); box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1); }
.layer-btn-label { font-size: 11px; font-weight: 700; color: var(--text-3); text-transform: uppercase; letter-spacing: 0.05em; }
.layer-btn-text { font-size: 14px; font-weight: 600; color: var(--text-1); display: flex; align-items: center; gap: 8px; }
.layer-btn-text svg { width: 16px; height: 16px; color: var(--text-2); }

/* ─── Responsive ─────────────────────────────────────────────────── */
@media (max-width: 960px) and (min-width: 769px) {
    :root { --sidebar-w: 80px; }
    .logo-text, .nav-item span, .nav-group-label, .nav-badge, .user-meta, .logout-btn { display: none; }
    .nav-item { padding: 12px; justify-content: center; gap: 0; margin: 4px 16px; }
    .nav-item svg { width: 22px; height: 22px; }
    .logo-mark { margin: 0 auto; width: 40px; height: 40px; }
    .sidebar-logo { justify-content: center; padding: 24px 0 20px; }
    .user-card { justify-content: center; background: transparent !important; }
}

@media (max-width: 768px) {
    .app { width: 100vw; height: 100dvh; border-radius: 0; border: none; box-shadow: none; }
    body { padding: 0; }

    /* Fix iOS input zoom by forcing 16px on mobile */
    input.form-control, textarea.form-control, select.form-control { font-size: 16px !important; }

    .hamburger { display: flex; }
    .sidebar {
        position: fixed; left: 0; bottom: 0; top: auto;
        width: 100% !important; max-height: 85vh;
        border-radius: 24px 24px 0 0; border-right: none;
        box-shadow: 0 -4px 24px rgba(0,0,0,0.15);
        transform: translateY(100%); transition: transform 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
    }
    .sidebar.open { transform: translateY(0); }
    .sidebar-logo { border-radius: 24px 24px 0 0; padding: 16px 24px 16px; position: sticky; top: 0; z-index: 1; background: var(--surface); }
    .sidebar-logo::before { content: ''; position: absolute; top: 8px; left: 50%; transform: translateX(-50%); width: 40px; height: 5px; background: var(--border-focus); border-radius: 4px; opacity: 0.5; }
    .nav-wrap { padding-bottom: 24px; }
    
    .list-col { width: 100% !important; min-width: 0; border-right: none; }
    .detail-col { position: fixed; inset: 0; z-index: 150; transform: translateX(100%); transition: transform var(--dur) var(--ease); }
    .detail-col.open { transform: translateX(0); }
    .back-btn { display: flex; width: 44px; height: 44px; } /* Daha rahat tıklanabilir mobile geri butonu */
    
    .search-input { width: 180px; }
    
    /* Mobile Panel Adjustments */
    .panel-header { padding: 16px 20px; }
    .panel-body { padding: 24px 20px; }
    .panel-section { margin-bottom: 36px; }
    .panel-footer { padding: 16px 20px; flex-direction: column-reverse; gap: 12px; }
    .panel-footer button { width: 100%; justify-content: center; }

    /* Mobile form grid reset */
    .form-grid { grid-template-columns: 1fr; }

    /* Mobile Layer Card (List view adjusts to block) */
    .layer-card { flex-direction: column; align-items: flex-start; gap: 16px; padding: 16px; }
    .layer-preview { width: 100%; height: 160px; }
    .layer-actions { width: 100%; flex-direction: column; margin-left: 0; }
    .layer-btn { width: 100%; align-items: center; flex-direction: row; justify-content: space-between; }
    .layer-desc { white-space: normal; }

    #emailsView { flex-direction: column; }
    .toast-container { right: 16px; left: 16px; top: 16px; align-items: center; }
    .toast { width: 100%; max-width: calc(100vw - 32px); }

    /* Video Config Grid Mobile */
    .video-config-grid { grid-template-columns: 1fr !important; padding: 20px !important; }
    .video-preview-col { width: 100% !important; }
}
