/* ========================================
   TEKNİK SERVİS YÖNETİM SİSTEMİ
   Ana Stil Dosyası
   ======================================== */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&family=JetBrains+Mono:wght@400;500&display=swap');

/* ---- CSS VARIABLES ---- */
:root {
  --primary: #6366f1;
  --primary-dark: #4f46e5;
  --primary-light: #818cf8;
  --secondary: #0ea5e9;
  --accent: #f59e0b;
  --success: #10b981;
  --danger: #ef4444;
  --warning: #f59e0b;
  --info: #06b6d4;

  --bg-base: #0f1117;
  --bg-surface: #1a1d27;
  --bg-card: #1e2235;
  --bg-card-hover: #252a3d;
  --bg-input: #111827;
  --bg-sidebar: #0d0f1a;

  --border: rgba(99, 102, 241, 0.18);
  --border-light: rgba(255, 255, 255, 0.06);
  --border-input: rgba(99, 102, 241, 0.25);

  --text-primary: #f1f5f9;
  --text-secondary: #94a3b8;
  --text-muted: #475569;
  --text-accent: #818cf8;

  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.4);
  --shadow-md: 0 4px 20px rgba(0, 0, 0, 0.5);
  --shadow-lg: 0 10px 40px rgba(0, 0, 0, 0.6);
  --shadow-glow: 0 0 30px rgba(99, 102, 241, 0.2);
  --shadow-glow-sm: 0 0 15px rgba(99, 102, 241, 0.15);

  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-xl: 22px;
  --radius-full: 9999px;

  --transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);

  --sidebar-width: 260px;
  --header-height: 64px;
}

/* ---- LIGHT THEME OVERRIDES ---- */
body.theme-light {
  --bg-base: #f8fafc;
  --bg-surface: #ffffff;
  --bg-card: #ffffff;
  --bg-card-hover: #f1f5f9;
  --bg-input: #f8fafc;
  --bg-sidebar: #ffffff;
  
  --border: #e2e8f0;
  --border-light: #f1f5f9;
  --border-input: #cbd5e1;
  
  --text-primary: #0f172a;
  --text-secondary: #334155;
  --text-muted: #64748b;
  
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.05);
  --shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.05);
  --shadow-glow: 0 0 20px rgba(99, 102, 241, 0.1);
  --shadow-glow-sm: 0 0 10px rgba(99, 102, 241, 0.05);
}
body.theme-light .sidebar { border-right: 1px solid var(--border); box-shadow: var(--shadow-sm); }
body.theme-light .sidebar::before { opacity: 0; }
body.theme-light .header { background: rgba(255,255,255,0.85); box-shadow: var(--shadow-sm); border-bottom: none; }
body.theme-light .input-icon { color: var(--text-muted); }
body.theme-light .form-control { border: 1px solid var(--border-input); color: var(--text-primary); }
body.theme-light .btn-secondary { background: #f1f5f9; color: var(--text-primary); border-color: var(--border); }
body.theme-light .btn-secondary:hover { background: #e2e8f0; }

/* ---- LOGIN SCREEN ---- */
.login-screen {
  position: fixed;
  inset: 0;
  background: var(--bg-base);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.4s ease, visibility 0.4s ease;
}

.login-screen.hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.login-box {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 40px;
  width: 100%;
  max-width: 400px;
  box-shadow: var(--shadow-lg), var(--shadow-glow);
  text-align: center;
  position: relative;
  z-index: 2;
}

.login-logo {
  font-size: 40px;
  color: var(--primary);
  margin-bottom: 15px;
}

.login-title {
  font-size: 22px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 5px;
}

.login-subtitle {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 30px;
}

/* ---- RESET & BASE ---- */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html { scroll-behavior: smooth; }
body {
  font-family: 'Inter', sans-serif;
  background: var(--bg-base);
  color: var(--text-primary);
  min-height: 100vh;
  line-height: 1.6;
  overflow-x: hidden;
}

::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--bg-surface); }
::-webkit-scrollbar-thumb { background: var(--primary); border-radius: var(--radius-full); }
::-webkit-scrollbar-thumb:hover { background: var(--primary-dark); }

.bg-animated { position: fixed; inset: 0; z-index: 0; overflow: hidden; pointer-events: none; }
.bg-animated::before {
  content: ''; position: absolute; top: -50%; left: -50%; width: 200%; height: 200%;
  background: radial-gradient(ellipse at 20% 20%, rgba(99, 102, 241, 0.08) 0%, transparent 50%),
              radial-gradient(ellipse at 80% 80%, rgba(14, 165, 233, 0.06) 0%, transparent 50%),
              radial-gradient(ellipse at 50% 50%, rgba(245, 158, 11, 0.03) 0%, transparent 70%);
  animation: bgPulse 12s ease-in-out infinite alternate;
}
.bg-grid {
  position: absolute; inset: 0; z-index: 0; pointer-events: none;
  background-image: linear-gradient(rgba(99,102,241,0.04) 1px, transparent 1px), linear-gradient(90deg, rgba(99,102,241,0.04) 1px, transparent 1px);
  background-size: 40px 40px;
}

@keyframes bgPulse { 0% { transform: scale(1) rotate(0deg); } 100% { transform: scale(1.1) rotate(3deg); } }

.app-layout { 
    position: relative; 
    z-index: 1; 
    width: 100%;
    max-width: 100vw;
}

/* ---- SIDEBAR ---- */
.sidebar {
  width: var(--sidebar-width); background: var(--bg-sidebar); border-right: 1px solid var(--border);
  display: flex; flex-direction: column; position: fixed; top: 0; left: 0; height: 100vh; z-index: 100;
  transition: var(--transition);
}
.sidebar::before { content: ''; position: absolute; top: 0; left: 0; right: 0; height: 2px; background: linear-gradient(90deg, var(--primary), var(--secondary), var(--accent)); }
.sidebar-logo { padding: 20px 20px 16px; border-bottom: 1px solid var(--border-light); display: flex; align-items: center; gap: 12px; }
.sidebar-logo-icon { width: 40px; height: 40px; background: linear-gradient(135deg, var(--primary), var(--secondary)); border-radius: var(--radius-md); display: flex; align-items: center; justify-content: center; font-size: 18px; box-shadow: var(--shadow-glow-sm); }
.sidebar-logo-text h2 { font-size: 13px; font-weight: 700; color: var(--text-primary); }
.sidebar-logo-text p { font-size: 10px; color: var(--text-muted); font-weight: 500; text-transform: uppercase; }

.sidebar-nav { flex: 1; overflow-y: auto; padding: 12px 0; }
.sidebar-section-label { font-size: 10px; font-weight: 600; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.1em; padding: 8px 20px 4px; }
.sidebar-link { display: flex; align-items: center; gap: 12px; padding: 10px 20px; color: var(--text-secondary); text-decoration: none; font-size: 13.5px; font-weight: 500; transition: var(--transition); border-left: 3px solid transparent; position: relative; }
.sidebar-link::before { content: ''; position: absolute; inset: 0; background: linear-gradient(90deg, rgba(99,102,241,0.1), transparent); opacity: 0; transition: var(--transition); }
.sidebar-link:hover { color: var(--text-primary); border-left-color: rgba(99,102,241,0.4); }
.sidebar-link:hover::before { opacity: 1; }
.sidebar-link.active { color: var(--primary-light); border-left-color: var(--primary); background: rgba(99, 102, 241, 0.08); }
.sidebar-link.active::before { opacity: 1; }
.sidebar-link .link-icon { font-size: 16px; width: 20px; text-align: center; }

.sidebar-footer { padding: 16px 20px; border-top: 1px solid var(--border-light); position: relative; }
.sidebar-user { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: var(--radius-md); background: rgba(255,255,255,0.03); cursor: pointer; transition: var(--transition); }
.sidebar-user:hover { background: rgba(255,255,255,0.06); }
.user-avatar { width: 34px; height: 34px; border-radius: var(--radius-full); background: linear-gradient(135deg, var(--primary), var(--accent)); display: flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 700; color: white; }
.user-info { flex: 1; min-width: 0; }
.user-info .user-name { font-size: 12.5px; font-weight: 600; color: var(--text-primary); }
.user-info .user-role { font-size: 10.5px; color: var(--text-muted); }

.logout-menu {
  display: none;
  position: absolute;
  bottom: 100%;
  left: 20px;
  right: 20px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  margin-bottom: 10px;
  padding: 5px;
  box-shadow: var(--shadow-lg);
}
.logout-menu.active {
  display: block;
}
.logout-btn {
  display: flex; align-items: center; gap: 10px; width: 100%; padding: 10px;
  background: transparent; border: none; color: var(--danger); font-size: 13px; font-weight: 600;
  cursor: pointer; border-radius: var(--radius-sm); transition: var(--transition); font-family: inherit;
}
.logout-btn:hover { background: rgba(239,68,68,0.1); }

/* ---- MAIN CONTENT ---- */
.main-content { 
    margin-left: var(--sidebar-width); 
    width: calc(100% - var(--sidebar-width));
    display: flex; 
    flex-direction: column; 
    min-height: 100vh;
    min-width: 0;
}
.header { height: var(--header-height); background: rgba(26, 29, 39, 0.8); backdrop-filter: blur(20px); border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; padding: 0 28px; position: sticky; top: 0; z-index: 50; }
.header-right { display: flex; align-items: center; gap: 10px; }
.page-title { font-size: 17px; font-weight: 700; color: var(--text-primary); }
.page-subtitle { font-size: 12px; color: var(--text-muted); }
.header-btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 7px 14px; background: rgba(255,255,255,0.05); border: 1px solid var(--border-light); border-radius: var(--radius-md); color: var(--text-secondary); font-size: 12.5px; font-weight: 500; cursor: pointer; transition: var(--transition); font-family: inherit; white-space: nowrap; }
.header-btn:hover { background: rgba(99,102,241,0.1); border-color: var(--border); color: var(--text-primary); }
.header-btn.primary { background: linear-gradient(135deg, var(--primary), var(--primary-dark)); border-color: var(--primary); color: white; box-shadow: var(--shadow-glow-sm); }
.header-btn.primary:hover { transform: translateY(-1px); box-shadow: var(--shadow-glow); }

.page-content { flex: 1; padding: 28px; display: none; animation: fadeInUp 0.35s ease; width: 100%; max-width: 100%; }
.page-content.active { display: block; }
@keyframes fadeInUp { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: translateY(0); } }

/* ---- STATS & CARDS ---- */
.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; margin-bottom: 28px; }
.stat-card { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 20px; display: flex; align-items: center; gap: 16px; position: relative; overflow: hidden; }
.stat-icon { width: 52px; height: 52px; border-radius: var(--radius-md); background: var(--stat-bg); display: flex; align-items: center; justify-content: center; font-size: 22px; flex-shrink: 0; }
.stat-value { font-size: 26px; font-weight: 800; color: var(--text-primary); }
.stat-label { font-size: 12px; color: var(--text-muted); font-weight: 500; }

.content-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-bottom: 20px; width: 100%; }
.content-grid.wide-right { grid-template-columns: 1fr 2fr; }
.card { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-lg); overflow: hidden; min-width: 0; width: 100%; }
.card-header { padding: 18px 20px 14px; border-bottom: 1px solid var(--border-light); display: flex; align-items: center; justify-content: space-between; }
.card-title { font-size: 14px; font-weight: 700; color: var(--text-primary); display: flex; align-items: center; gap: 8px; }
.card-body { padding: 20px; overflow-x: auto; max-width: 100%; }

/* ---- TABLES ---- */
table { width: 100%; border-collapse: collapse; }
th, td { padding: 14px 20px; text-align: left; border-bottom: 1px solid var(--border-light); font-size: 13px; color: var(--text-primary); }
th { font-weight: 700; color: var(--text-secondary); text-transform: uppercase; font-size: 11px; letter-spacing: 0.5px; background: rgba(0,0,0,0.02); }
tbody tr:hover { background: rgba(255,255,255,0.02); }
body.theme-light tbody tr:hover { background: rgba(0,0,0,0.02); }
.badge { display: inline-block; padding: 4px 8px; border-radius: 4px; font-size: 10.5px; font-weight: 600; text-transform: uppercase; }

/* ---- FORMS ---- */
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-grid.three { grid-template-columns: 1fr 1fr 1fr; }
.form-group.span-2 { grid-column: span 2; }
.form-group.span-3 { grid-column: span 3; }
.form-group.span-full { grid-column: 1 / -1; }

label { font-size: 12px; font-weight: 600; color: var(--text-secondary); display: block; margin-bottom: 6px; }
label .required { color: var(--danger); }
.form-control { background: var(--bg-input); border: 1px solid var(--border-input); border-radius: var(--radius-md); padding: 10px 13px; color: var(--text-primary); font-size: 13px; font-family: inherit; width: 100%; outline: none; transition: var(--transition); }
.form-control:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(99,102,241,0.12); }
textarea.form-control { resize: vertical; min-height: 90px; }
.input-group { position: relative; display: flex; align-items: center; }
.input-group .form-control { padding-left: 38px; }
.input-icon { position: absolute; left: 12px; color: var(--text-muted); font-size: 14px; pointer-events: none; z-index: 1; }

.custom-select { position: relative; width: 100%; max-width: 100%; }
.custom-select-btn {
  width: 100%;
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 13px;
  background: var(--bg-input);
  border: 1px solid var(--border-input);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  cursor: pointer;
  transition: var(--transition);
  font-family: inherit;
  font-size: 13px;
}
.custom-select-btn:hover { border-color: var(--primary); }
.custom-select-menu {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  right: 0;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  z-index: 2000;
  overflow: hidden;
}
.custom-select-search { padding: 10px; border-bottom: 1px solid var(--border-light); }
.custom-select-options { max-height: 260px; overflow: auto; }
.custom-select-option {
  padding: 10px 12px;
  cursor: pointer;
  border-bottom: 1px solid var(--border-light);
  color: var(--text-secondary);
  font-weight: 600;
}
.custom-select-option:hover { background: rgba(99,102,241,0.12); color: var(--text-primary); }
.custom-select-option:last-child { border-bottom: none; }

/* Fiziksel servis formuna uyumlu checkbox container */
.form-cb-container {
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    overflow: hidden;
    margin-bottom: 8px;
}
.form-cb-row {
    padding: 10px 14px;
    border-bottom: 1px solid var(--border);
}
.form-cb-row:last-child { border-bottom: none; }
.form-cb-row-label {
    font-weight: 700;
    color: var(--text-secondary);
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    margin-bottom: 8px;
}

.checkbox-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 8px; }
.checkbox-wrapper {
    display: flex; align-items: center; justify-content: center; gap: 8px; cursor: pointer; font-size: 12.5px; font-weight: 600;
    color: var(--text-secondary); background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-md);
    padding: 10px; transition: var(--transition); user-select: none; text-align: center; white-space: nowrap; height: 100%;
}
.checkbox-wrapper:hover { border-color: var(--primary-light); color: var(--text-primary); }
.checkbox-wrapper input[type="checkbox"], .checkbox-wrapper input[type="radio"] { display: none; }
.checkbox-wrapper:has(input:checked) { background: rgba(99, 102, 241, 0.15); border-color: var(--primary); color: var(--primary-light); box-shadow: 0 0 10px rgba(99, 102, 241, 0.2); }

/* ---- BUTTONS ---- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; padding: 10px 20px; border-radius: var(--radius-md); font-family: inherit; font-size: 13px; font-weight: 600; cursor: pointer; border: none; transition: var(--transition); }
.btn-primary { background: linear-gradient(135deg, var(--primary), var(--primary-dark)); color: white; box-shadow: var(--shadow-glow-sm); }
.btn-secondary { background: rgba(255,255,255,0.06); border: 1px solid var(--border-light); color: var(--text-secondary); }
.btn-success { background: linear-gradient(135deg, var(--success), #059669); color: white; }
.btn-outline { background: transparent; border: 1px solid var(--border); color: var(--text-secondary); }

/* ---- TOAST ---- */
.toast-container { position: fixed; top: 20px; right: 20px; z-index: 9999; display: flex; flex-direction: column; gap: 10px; }
.toast { display: flex; align-items: center; gap: 12px; padding: 14px 18px; background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-md); box-shadow: var(--shadow-lg); animation: slideInRight 0.3s forwards; position: relative; overflow: hidden; }
.toast::before { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--toast-color, var(--primary)); }
@keyframes slideInRight { from { transform: translateX(100%); opacity: 0; } to { transform: translateX(0); opacity: 1; } }
@keyframes slideOutRight { from { transform: translateX(0); opacity: 1; } to { transform: translateX(100%); opacity: 0; } }
.toast.hiding { animation: slideOutRight 0.3s forwards; }
.toast-icon { font-size: 20px; }
.toast-message { font-size: 13px; color: var(--text-primary); }

/* ---- MODAL ---- */
.modal-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.7); backdrop-filter: blur(4px); z-index: 1000; display: flex; align-items: center; justify-content: center; padding: 20px; opacity: 0; pointer-events: none; transition: opacity 0.25s; }
.modal-overlay.active { opacity: 1; pointer-events: all; }
.modal { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-xl); width: 100%; max-width: 700px; max-height: 90vh; overflow-y: auto; transform: translateY(20px); transition: var(--transition); }
.modal-overlay.active .modal { transform: translateY(0); }
.modal-header { padding: 22px 24px 18px; border-bottom: 1px solid var(--border-light); display: flex; justify-content: space-between; align-items: center; }
.modal-title { font-size: 16px; font-weight: 700; color: var(--text-primary); }
.modal-close { width: 30px; height: 30px; border-radius: var(--radius-sm); background: rgba(255,255,255,0.06); border: 1px solid var(--border-light); color: var(--text-muted); cursor: pointer; display: flex; align-items: center; justify-content: center; }
.modal-body { padding: 24px; }
.modal-footer { padding: 16px 24px; border-top: 1px solid var(--border-light); display: flex; justify-content: flex-end; gap: 10px; }

/* ---- PDF TEMPLATE (HIDDEN FOR PRINTING) ---- */
#pdf-template { display: none; }
@media print {
  body * { display: none; }
  #pdf-template, #pdf-template * { display: block; visibility: visible; }
  #pdf-template { position: absolute; left: 0; top: 0; width: 100%; border: none; }
}

/* CUSTOMER GRID */
.customer-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; }
.customer-card { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 18px; display: flex; flex-direction: column; gap: 12px; }
.customer-card-header { display: flex; gap: 12px; align-items: center; }
.customer-avatar { width: 44px; height: 44px; border-radius: var(--radius-md); display: flex; align-items: center; justify-content: center; font-weight: 700; color: white; background: var(--primary); }
.customer-card-name { font-size: 14px; font-weight: 700; }
.customer-card-company { font-size: 12px; color: var(--text-muted); }
.customer-meta-item { font-size: 11.5px; color: var(--text-muted); margin-bottom: 4px; }

/* Dashboard forms trend chart */
#formsTrendChartWrap svg { display:block; }

/* Trend table visuals */
.trend-date-chip{
  display:inline-flex;
  align-items:center;
  padding:6px 10px;
  border-radius:999px;
  background:rgba(239,68,68,0.08);
  border:1px solid rgba(239,68,68,0.22);
  color:var(--text-primary);
  font-weight:800;
  font-size:12px;
  white-space:nowrap;
}
.trend-count-badge{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  min-width:34px;
  padding:6px 10px;
  border-radius:999px;
  background:rgba(239,68,68,0.12);
  border:1px solid rgba(239,68,68,0.28);
  color:var(--text-primary);
  font-weight:900;
  font-size:12px;
}
.trend-bar{
  width:88px;
  height:8px;
  background:rgba(239,68,68,0.10);
  border:1px solid rgba(239,68,68,0.18);
  border-radius:999px;
  overflow:hidden;
}
.trend-bar-fill{
  height:100%;
  background:linear-gradient(90deg, rgba(239,68,68,0.85), rgba(239,68,68,0.15));
  border-radius:999px;
}

/* ---- MOBILE RESPONSIVE ---- */
.mobile-menu-btn { display: none; }

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

/* Sidebar rozet */
.sidebar-badge { display: inline-flex; align-items: center; justify-content: center; background: var(--danger); color: white; font-size: 10px; font-weight: 700; min-width: 18px; height: 18px; border-radius: 9px; padding: 0 5px; margin-left: auto; line-height: 1; }
.sidebar-link { display: flex; align-items: center; gap: 8px; }

/* Geçmiş formlar filtre barı */
.forms-filter-bar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 20px; }
.forms-filter-dates { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; flex: 1; min-width: 0; }
.forms-filter-dates input[type="date"] { flex: 1; min-width: 100px; max-width: 160px; font-size: 13px; padding: 8px 10px; }
.forms-filter-dates .btn { flex-shrink: 0; white-space: nowrap; }

@media (max-width: 768px) {
  .forms-filter-bar { flex-direction: column; align-items: stretch; }
  .forms-filter-dates { flex-direction: row; }
  .forms-filter-dates input[type="date"] { font-size: 12px; padding: 6px 8px; min-width: 0; max-width: none; }
}

/* Ziyaret istatistik barı */
.visit-stats-bar { display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 18px; }
.visit-stat-item { display: flex; align-items: center; gap: 8px; background: var(--bg-card); border: 1px solid var(--border-light); border-radius: var(--radius); padding: 10px 16px; flex: 1; min-width: 110px; }
.visit-stat-val { font-size: 22px; font-weight: 800; color: var(--text-primary); line-height: 1; }
.visit-stat-lbl { font-size: 11px; color: var(--text-muted); white-space: normal; line-height: 1.25; }

.col-span-2 { grid-column: span 2; }
.wide-right { grid-template-columns: 1fr 2fr; }

@media (max-width: 768px) {
  .col-span-2 { grid-column: span 1 !important; }
  .sidebar { transform: translateX(-100%); box-shadow: var(--shadow-xl); z-index: 1000; }
  .sidebar.mobile-active { transform: translateX(0); }
  .main-content { margin-left: 0; width: 100%; }
  
  .header { padding: 0 15px; height: auto; min-height: var(--header-height); flex-wrap: wrap; padding-top: 10px; padding-bottom: 10px; gap: 10px; }
  .header-left { display: flex; align-items: center; gap: 15px; width: 100%; justify-content: flex-start;}
  .header-left > div { flex: 1; }
  .mobile-menu-btn { display: block; font-size: 20px; color: var(--text-primary); background: transparent; border: none; cursor: pointer; padding-right: 15px; }
  
  .header-right { width: 100%; display: flex; justify-content: flex-start; gap: 8px; margin-top: 5px; overflow-x: auto; padding-bottom: 5px; }
  .header-btn { padding: 8px 12px; font-size: 12px; white-space: nowrap; flex-shrink: 0; }
  
  .content-grid, .stats-grid, .form-grid, .form-grid.three { grid-template-columns: 1fr !important; }
  .form-group.span-2, .form-group.span-3 { grid-column: span 1 !important; }
  
  .checkbox-grid { grid-template-columns: 1fr 1fr !important; }
  
  .card-body, .page-content { padding: 15px; padding-left: 10px; padding-right: 10px; }
  
  /* Tables horizontally scrollable */
  table { display: block; width: 100%; overflow-x: auto; white-space: nowrap; -webkit-overflow-scrolling: touch; }
  th, td { padding: 10px 12px; font-size: 12px; }
  
  /* Modals */
  .modal { width: 100%; margin: 10px; max-height: 95vh; }
  .modal-body { padding: 15px; }
}

@media (max-width: 480px) {
  /* Smaller phones like iPhone SE/X */
  .login-box { padding: 30px 20px; width: 92%; }
  
  .page-title { font-size: 16px; }
  .page-subtitle { font-size: 11px; }
  
  .stat-card { flex-direction: column; text-align: center; gap: 10px; padding: 12px; }
  .stat-card select { width: 100%; margin-top: 10px; }
  .stat-info { width: 100%; max-width: 100%; }
  .stat-info > div { flex-direction: column !important; gap: 5px; }
  .stat-value { font-size: 20px; }
  .stat-label { font-size: 11px; }
  
  .checkbox-grid { grid-template-columns: 1fr 1fr !important; gap: 8px; }
  .checkbox-wrapper { font-size: 11px; }
  
  .customer-card { padding: 15px; }
  .customer-grid { grid-template-columns: 1fr; }
  
  .input-group { width: 100% !important; }
  
  /* Buttons expand to full width if needed */
  .btn { width: 100%; justify-content: center; }
  .modal-footer { flex-direction: column; width: 100%; }
  .modal-footer .btn { margin-bottom: 10px; }
  .visit-stats-bar { gap: 8px; }
  .visit-stat-item {
    min-width: 0;
    padding: 8px 10px;
    align-items: flex-start;
    gap: 6px;
  }
  .visit-stat-val { font-size: 16px; }
  .visit-stat-lbl { font-size: 10px; }

  .history-actions .btn {
    width: auto !important;
    padding: 3px 6px !important;
    font-size: 10px !important;
    margin-right: 2px !important;
    gap: 4px !important;
  }
  .history-actions .btn i {
    font-size: 10px;
  }
}

/* ---- ROLE BASED ACCESS CONTROL (RBAC) ---- */
.role-restricted [data-role="admin"] {
  display: none !important;
}

/* ---- CALENDAR ---- */
.calendar-layout { display: grid; grid-template-columns: repeat(7, 1fr); gap: 8px; }
.calendar-day-name { text-align: center; font-weight: 700; padding: 5px; color: var(--text-muted); font-size: 11px; text-transform:uppercase; background:rgba(0,0,0,0.1); border-radius: var(--radius-sm); }
.calendar-day { min-height: 80px; background: rgba(255,255,255,0.02); border: 1px solid var(--border-light); border-radius: var(--radius-sm); padding: 5px; transition: var(--transition); cursor: pointer; display: flex; flex-direction: column; overflow: hidden; }
body.theme-light .calendar-day { background: #f8fafc; }
.calendar-day:hover { border-color: var(--primary); background: rgba(99,102,241,0.05); }
.calendar-day.today { border-color: var(--primary); box-shadow: inset 0 0 0 1px var(--primary); }
.calendar-day.empty { visibility: hidden; }
.calendar-date { font-size: 12px; font-weight: bold; color: var(--text-secondary); margin-bottom: 5px; text-align: right; }
.calendar-day.today .calendar-date { color: var(--primary); }
.calendar-event { font-size: 10px; background: var(--primary); color: white; padding: 3px 6px; border-radius: 4px; margin-bottom: 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.calendar-event.done { background: var(--success); text-decoration: line-through; opacity: 0.8; }

/* Takvim başlığı - ay adı + yıl iki satır */
#calendarMonthYear { text-align: center; line-height: 1.2; white-space: nowrap; font-size: 15px; }

/* Mobil minimal takvim hücreleri */
.cal-mobile { min-height: 38px !important; border: none !important; background: transparent !important; border-radius: 50% !important; align-items: center !important; justify-content: flex-start !important; padding: 4px 2px !important; position: relative; }
.cal-mobile:hover { background: rgba(99,102,241,0.1) !important; border-radius: 8px !important; }
.cal-mobile.today { background: rgba(99,102,241,0.15) !important; border-radius: 8px !important; box-shadow: none !important; }
.cal-mobile .calendar-date { font-size: 13px; margin-bottom: 0; text-align: center; width: 100%; }
.cal-mobile.today .calendar-date { color: var(--primary); font-weight: 800; }

/* Etkinlik göstergesi (nokta/çizgi) */
.cal-dot { display: block; width: 5px; height: 5px; border-radius: 50%; background: var(--danger); margin: 0 auto; margin-top: 2px; flex-shrink: 0; }

@media (max-width: 768px) {
  .calendar-layout { gap: 2px; }
  #calendarMonthYear { font-size: 13px; }
  #page-ajanda .card .card-header { gap: 8px; }
  #page-ajanda .card .card-header .btn { width: auto; padding: 6px 9px; }
}

/* ---- KAYDET PANELİ SEÇENEK BUTONLARI ---- */
.save-action-option {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 16px;
  border-radius: var(--radius-md);
  border: 1.5px solid var(--border-light);
  background: var(--bg-card);
  color: var(--text-secondary);
  cursor: pointer;
  font-size: 12.5px;
  font-weight: 600;
  user-select: none;
  transition: var(--transition);
  white-space: nowrap;
}
.save-action-option:hover {
  border-color: var(--primary-light);
  color: var(--text-primary);
  background: rgba(99,102,241,0.08);
}
.save-action-option.active {
  border-color: var(--primary);
  background: rgba(99,102,241,0.18);
  color: var(--primary-light);
  box-shadow: 0 0 10px rgba(99,102,241,0.18);
}
.save-action-option.active-pdf {
  border-color: #ef4444;
  background: rgba(239,68,68,0.13);
  color: #f87171;
  box-shadow: 0 0 10px rgba(239,68,68,0.15);
}
.save-action-option.active-bana {
  border-color: var(--success);
  background: rgba(16,185,129,0.13);
  color: #34d399;
  box-shadow: 0 0 10px rgba(16,185,129,0.15);
}
.save-action-option.active-onay {
  border-color: #f59e0b;
  background: rgba(245,158,11,0.13);
  color: #fbbf24;
  box-shadow: 0 0 10px rgba(245,158,11,0.15);
}
.save-action-icon {
  font-size: 15px;
}
.save-action-label {
  font-size: 12.5px;
}
@media (max-width: 600px) {
  .save-action-option { padding: 8px 10px; font-size: 11.5px; }
  .save-action-label { display: none; }
}
