:root {
  --taskbar-height: 48px;
  --tabbar-height: 30px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: "Segoe UI", -apple-system, BlinkMacSystemFont, sans-serif;
  overflow: hidden;
  height: 100vh;
  user-select: none;
}

/* Tema */
body.light { background-color: #5674a9; color: #222; }
body.dark { background-color: #121212; color: #eee; }

/* Masaüstü */
.desktop {
  position: absolute;
  top: calc(var(--taskbar-height) + var(--tabbar-height)); left: 0; right: 0;
  bottom: 0;
  background-size: cover;
  background-position: center;
  -webkit-user-select: none;
  user-select: none;
}

body.light .desktop { background: var(--desktop-wallpaper, #5674a9); }
body.dark .desktop { background: var(--desktop-wallpaper, linear-gradient(135deg, #121212 0%, #1e1e1e 50%, #2c2c2c 100%)); }

/* Masaüstü ikonları */
.desktop-icons {
  display: flex;
  flex-direction: column;
  flex-wrap: wrap;
  gap: 8px;
  padding: 15px;
  height: 100%;
  align-content: flex-start;
  -webkit-user-select: none;
  user-select: none;
}

.desktop-icon {
  width: 80px;
  text-align: center;
  cursor: pointer;
  padding: 8px 4px;
  border-radius: 8px;
  transition: background 0.15s;
  -webkit-user-select: none;
  user-select: none;
}

.desktop-icon:hover { background: rgba(255,255,255,0.12); }
.desktop-icon:active { background: rgba(255,255,255,0.2); }
.desktop-icon.dragging {
  opacity: 1;
  background: rgba(255,255,255,0.16);
}

.desktop-icon .icon-img {
  font-size: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  margin: 0 auto 4px;
  background: rgba(255,255,255,0.1);
  border: 1.5px solid rgba(255,255,255,0.3);
  border-radius: 12px;
  color: #fff;
  font-family: "Segoe UI", sans-serif;
  font-weight: 300;
  line-height: 1;
  -webkit-user-select: none;
  user-select: none;
}

.desktop-icon:hover .icon-img {
  background: rgba(255,255,255,0.18);
  border-color: rgba(255,255,255,0.5);
}

.desktop-icon .icon-label {
  font-size: 11px;
  color: #fff;
  text-shadow: 1px 1px 3px rgba(0,0,0,0.8);
  word-wrap: break-word;
  line-height: 1.3;
  -webkit-user-select: none;
  user-select: none;
}

.desktop-icons.size-small .desktop-icon {
  width: 72px;
  padding: 6px 3px;
}

.desktop-icons.size-small .icon-img {
  width: 40px;
  height: 40px;
  font-size: 26px;
  border-radius: 10px;
}

.desktop-icons.size-small .icon-label {
  font-size: 10px;
}

.desktop-icons.size-medium .desktop-icon {
  width: 80px;
}

.desktop-icons.size-large .desktop-icon {
  width: 96px;
  padding: 10px 4px;
}

.desktop-icons.size-large .icon-img {
  width: 58px;
  height: 58px;
  font-size: 38px;
  border-radius: 14px;
  margin-bottom: 6px;
}

.desktop-icons.size-large .icon-label {
  font-size: 12px;
}

/* Sağ tık menü */
.context-menu {
  display: none;
  position: absolute;
  background: #2d2d2d;
  border: 1px solid #555;
  border-radius: 8px;
  box-shadow: 3px 3px 15px rgba(0,0,0,0.5);
  z-index: 500;
  min-width: 190px;
  padding: 4px 0;
}

.context-menu .menu-item {
  padding: 8px 16px;
  color: #eee;
  cursor: pointer;
  font-size: 13px;
  display: flex;
  align-items: center;
  gap: 8px;
  justify-content: space-between;
  position: relative;
}

.context-menu .menu-item:hover { background: #0078d7; }
.context-menu .menu-divider { height: 1px; background: #555; margin: 4px 0; }

.context-menu .has-submenu .submenu-arrow {
  color: rgba(255,255,255,0.75);
  font-size: 14px;
  margin-left: 16px;
}

.context-menu .submenu {
  display: none;
  position: absolute;
  top: -4px;
  left: calc(100% - 6px);
  min-width: 170px;
  background: #2d2d2d;
  border: 1px solid #555;
  border-radius: 8px;
  box-shadow: 3px 3px 15px rgba(0,0,0,0.5);
  padding: 4px 0;
  z-index: 520;
}

.context-menu .has-submenu:hover .submenu {
  display: block;
}

.context-menu .submenu .menu-item {
  justify-content: flex-start;
}

/* === ÜST BAR (Taskbar) === */
.taskbar {
  position: fixed;
  top: 0;
  width: 100%;
  height: var(--taskbar-height);
  background: #3c5998;
  display: flex;
  align-items: center;
  padding: 0 10px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.4);
  z-index: 100;
}

.start-btn {
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.15);
  color: #fff;
  font-size: 20px;
  cursor: pointer;
  padding: 6px 12px;
  border-radius: 6px;
  margin-right: 6px;
  font-weight: 300;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s;
  flex-shrink: 0;
  width: 36px;
  height: 36px;
}

.start-btn:hover { background: rgba(255,255,255,0.15); }

.taskbar-logo {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-right: 10px;
  padding-right: 10px;
  border-right: 1px solid rgba(255,255,255,0.12);
  flex-shrink: 0;
}

.taskbar-logo-mark {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: rgba(255,255,255,0.14);
  border: 1px solid rgba(255,255,255,0.18);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.4px;
}

.taskbar-logo-text {
  display: flex;
  flex-direction: column;
  line-height: 1.05;
}

.taskbar-logo-text strong {
  color: #fff;
  font-size: 11px;
  font-weight: 700;
}

.taskbar-logo-text span {
  color: rgba(255,255,255,0.45);
  font-size: 9px;
  letter-spacing: 0.4px;
  text-transform: uppercase;
}

/* Tab bar (açık sekmeler) */
.tab-bar {
  position: fixed;
  top: var(--taskbar-height);
  left: 0;
  right: 0;
  height: var(--tabbar-height);
  background: #2e4a80;
  display: flex;
  align-items: center;
  padding: 0 10px;
  gap: 0;
  z-index: 99;
  overflow-x: auto;
  box-shadow: 0 1px 4px rgba(0,0,0,0.2);
}

.tab-item {
  background: none;
  border: none;
  color: rgba(255,255,255,0.55);
  font-size: 11px;
  font-family: inherit;
  cursor: pointer;
  padding: 5px 14px;
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 5px;
  transition: all 0.15s;
  border-radius: 4px 4px 0 0;
  position: relative;
}

.tab-item.dragging {
  opacity: 0.45;
}

.tab-item:hover { color: #fff; background: rgba(255,255,255,0.08); }
.tab-item.active { color: #fff; background: rgba(255,255,255,0.12); }
.tab-item.minimized {
  color: rgba(255,255,255,0.42);
}

.tab-item.minimized:hover {
  color: rgba(255,255,255,0.88);
}

.tab-home {
  color: #fff;
  background: rgba(255,255,255,0.1);
  font-weight: 600;
  margin-right: 8px;
  border-right: 1px solid rgba(255,255,255,0.12);
  border-radius: 4px;
  padding-right: 16px;
}

.tab-home:hover { background: rgba(255,255,255,0.16); }

.tab-home-icon {
  font-size: 13px;
  opacity: 0.95;
}

.tab-item.active::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 20%; right: 20%;
  height: 2px;
  background: #64b5f6;
  border-radius: 1px;
}

.tab-close {
  font-size: 10px;
  opacity: 0;
  margin-left: 4px;
  transition: opacity 0.1s;
}

.tab-item:hover .tab-close { opacity: 0.6; }
.tab-close:hover { opacity: 1 !important; }

/* Taskbar gradient animation */
@keyframes taskbarGradient {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

.taskbar-app.active {
  color: #fff !important;
  background: linear-gradient(90deg, rgba(255,255,255,0.08), rgba(255,255,255,0.18), rgba(255,255,255,0.08));
  background-size: 200% 100%;
  animation: taskbarGradient 3s ease infinite;
}

.taskbar-app:hover { color: #fff; }

/* Müşteri sağ tık menü */
.row-context-menu {
  display: none;
  position: fixed;
  background: #2d2d2d;
  border: 1px solid #555;
  border-radius: 8px;
  box-shadow: 3px 3px 15px rgba(0,0,0,0.5);
  z-index: 600;
  min-width: 180px;
  padding: 4px 0;
}

.row-context-menu .ctx-item {
  padding: 8px 14px;
  color: #eee;
  cursor: pointer;
  font-size: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: background 0.1s;
}

.row-context-menu .ctx-item:hover { background: #0078d7; }

/* Müşteri detay görünümü */
.detail-view {
  display: flex;
  flex-direction: column;
  height: 100%;
}

.detail-toolbar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  background: #f8f9fa;
  border-bottom: 1px solid #e8e8e8;
  flex-shrink: 0;
}

body.dark .detail-toolbar { background: #252525; border-color: #333; }

.btn-back {
  background: none;
  border: 1px solid #d0d5dd;
  color: #555;
  padding: 4px 10px;
  border-radius: 5px;
  cursor: pointer;
  font-size: 13px;
  font-family: inherit;
  display: flex;
  align-items: center;
  gap: 4px;
  transition: all 0.15s;
}

.btn-back:hover { background: #f0f0f0; }
body.dark .btn-back { color: #ccc; border-color: #555; }
body.dark .btn-back:hover { background: #333; }

.detail-body {
  padding: 14px;
  overflow: auto;
  flex: 1;
}

.detail-header {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 16px;
  padding-bottom: 14px;
  border-bottom: 1px solid #e8e8e8;
}

body.dark .detail-header { border-color: #333; }

.detail-avatar {
  width: 50px; height: 50px;
  background: linear-gradient(135deg, #3c5998, #5674a9);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 20px; color: #fff; font-weight: 700;
  flex-shrink: 0;
}

.detail-info h3 { font-size: 16px; margin: 0 0 2px; }
.detail-info p { font-size: 12px; color: #888; margin: 0; }

.detail-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.detail-field label {
  display: block;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: #888;
  font-weight: 600;
  margin-bottom: 3px;
}

.detail-field span {
  font-size: 13px;
  display: block;
}

/* Firma adı - sağda */
.taskbar-firm {
  color: rgba(255,255,255,0.45);
  font-size: 10px;
  white-space: nowrap;
  margin-left: 8px;
  padding-left: 10px;
  border-left: 1px solid rgba(255,255,255,0.12);
  line-height: 1.2;
  flex-shrink: 0;
  text-align: right;
}

.taskbar-firm .firm-name { color: rgba(255,255,255,0.85); font-weight: 600; font-size: 11px; }

/* Çıkış butonu */
.taskbar-logout {
  background: none;
  border: 1px solid rgba(255,255,255,0.12);
  color: rgba(255,255,255,0.6);
  font-size: 16px;
  cursor: pointer;
  padding: 4px 10px;
  border-radius: 6px;
  margin-left: 8px;
  transition: all 0.15s;
  flex-shrink: 0;
  font-family: inherit;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

.taskbar-logout:hover { background: rgba(255,70,70,0.2); border-color: rgba(255,70,70,0.4); color: #ff6b6b; }

/* Çıkış / Login ekranı */
.logout-overlay {
  display: none;
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.7);
  backdrop-filter: blur(8px);
  z-index: 9999;
  justify-content: center;
  align-items: center;
}

.logout-overlay.show { display: flex; }

.logout-box {
  background: rgba(25,25,45,0.95);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 16px;
  padding: 40px 50px;
  text-align: center;
  box-shadow: 0 20px 60px rgba(0,0,0,0.5);
  min-width: 360px;
}

.logout-box .logout-avatar {
  width: 70px; height: 70px;
  background: linear-gradient(135deg, #3c5998, #5674a9);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 28px; color: #fff; font-weight: 700;
  margin: 0 auto 16px;
  border: 3px solid rgba(255,255,255,0.15);
}

.logout-box h2 { color: #fff; font-size: 18px; margin-bottom: 4px; font-weight: 600; }
.logout-box .logout-firm { color: rgba(255,255,255,0.4); font-size: 12px; margin-bottom: 24px; }
.logout-box .logout-msg { color: rgba(255,255,255,0.6); font-size: 13px; margin-bottom: 24px; line-height: 1.5; }

.logout-actions { display: flex; gap: 10px; justify-content: center; }

.logout-actions button {
  padding: 10px 28px;
  border: none;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  transition: all 0.15s;
}

.btn-logout-confirm { background: #c62828; color: #fff; }
.btn-logout-confirm:hover { background: #e53935; }

.btn-logout-cancel {
  background: rgba(255,255,255,0.08);
  color: rgba(255,255,255,0.7);
  border: 1px solid rgba(255,255,255,0.15) !important;
}

.btn-logout-cancel:hover { background: rgba(255,255,255,0.12); color: #fff; }

/* Login ekranı */
.login-overlay {
  display: none;
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: #5674a9;
  z-index: 10000;
  justify-content: center;
  align-items: center;
}

.login-overlay.show { display: flex; }

.login-box {
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 16px;
  padding: 40px 50px;
  text-align: center;
  box-shadow: 0 20px 60px rgba(0,0,0,0.3);
  min-width: 380px;
  backdrop-filter: blur(10px);
}

.login-box .login-logo { font-size: 36px; color: #fff; margin-bottom: 8px; font-weight: 700; }
.login-box .login-subtitle { color: rgba(255,255,255,0.4); font-size: 12px; margin-bottom: 30px; }

.login-box .login-field {
  width: 100%;
  padding: 11px 14px;
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 8px;
  background: rgba(255,255,255,0.06);
  color: #fff;
  font-size: 13px;
  font-family: inherit;
  outline: none;
  margin-bottom: 12px;
  transition: border 0.15s;
}

.login-box .login-field::placeholder { color: rgba(255,255,255,0.3); }
.login-box .login-field:focus { border-color: rgba(255,255,255,0.3); background: rgba(255,255,255,0.08); }

.login-box .btn-login {
  width: 100%;
  padding: 11px;
  background: #3c5998;
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  margin-top: 6px;
  transition: all 0.15s;
}

.login-box .btn-login:hover { background: #4a6baf; }
.login-box .login-footer { color: rgba(255,255,255,0.3); font-size: 11px; margin-top: 20px; }

/* Favoriler */
.taskbar-favs {
  display: flex;
  align-items: center;
  gap: 1px;
  margin-right: 8px;
  padding-right: 8px;
  border-right: 1px solid rgba(255,255,255,0.12);
  flex-shrink: 0;
}

.fav-btn {
  background: none;
  border: none;
  color: rgba(255,255,255,0.6);
  font-size: 12px;
  cursor: pointer;
  padding: 5px 8px;
  border-radius: 4px;
  white-space: nowrap;
  font-family: inherit;
  transition: all 0.15s;
  display: flex;
  align-items: center;
  gap: 4px;
}

.fav-btn:hover { background: rgba(255,255,255,0.1); color: #fff; }
.fav-btn .fav-icon { font-size: 13px; }

/* Arama */
.taskbar-search {
  position: relative;
  margin-right: 8px;
  flex-shrink: 0;
}

.taskbar-search input {
  width: 220px;
  padding: 6px 10px 6px 28px;
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 6px;
  background: rgba(255,255,255,0.07);
  color: #fff;
  font-size: 12px;
  font-family: inherit;
  outline: none;
  transition: all 0.2s;
}

.taskbar-search input::placeholder { color: rgba(255,255,255,0.35); }
.taskbar-search input:focus { background: rgba(255,255,255,0.12); border-color: rgba(255,255,255,0.25); width: 280px; }

.taskbar-search::before {
  content: '\2315';
  position: absolute;
  left: 9px; top: 50%;
  transform: translateY(-50%);
  font-size: 13px;
  color: rgba(255,255,255,0.35);
  pointer-events: none;
}

/* Açık pencereler */
.taskbar-apps {
  display: flex;
  flex: 1;
  align-items: center;
  gap: 2px;
  overflow-x: auto;
  padding: 0 4px;
  min-width: 0;
}

.taskbar-app {
  background: none;
  color: rgba(255,255,255,0.7);
  border: none;
  padding: 6px 12px;
  cursor: pointer;
  border-radius: 5px;
  font-size: 12px;
  white-space: nowrap;
  position: relative;
  transition: all 0.15s;
  font-family: inherit;
}

.taskbar-app:hover { background: rgba(255,255,255,0.1); color: #fff; }

.taskbar-tray {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-left: auto;
  padding: 0 8px;
  color: rgba(255,255,255,0.7);
  font-size: 12px;
}

.tray-icon {
  font-size: 15px;
  cursor: pointer;
  padding: 4px;
  border-radius: 4px;
  transition: background 0.15s;
  position: relative;
}

.tray-icon:hover { background: rgba(255,255,255,0.1); color: #fff; }

.tray-badge {
  position: absolute;
  top: 0; right: 0;
  width: 14px; height: 14px;
  background: #f44336;
  color: #fff;
  font-size: 8px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700;
}

.taskbar-clock {
  font-size: 12px;
  color: rgba(255,255,255,0.8);
  padding: 0 10px;
  text-align: right;
  cursor: pointer;
  line-height: 1.3;
}

/* Başlat menüsü */
.start-menu {
  display: none;
  position: fixed;
  top: 52px;
  left: 10px;
  width: 300px;
  background: rgba(25,25,40,0.97);
  backdrop-filter: blur(20px);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 10px;
  box-shadow: 0 10px 40px rgba(0,0,0,0.6);
  z-index: 200;
  padding: 8px 0;
}

.start-menu-header {
  padding: 10px 16px;
  color: rgba(255,255,255,0.4);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  font-weight: 600;
}

.start-menu-item {
  padding: 10px 16px;
  color: #eee;
  cursor: pointer;
  font-size: 13px;
  display: flex;
  align-items: center;
  gap: 10px;
  transition: background 0.1s;
}

.start-menu-item:hover { background: rgba(255,255,255,0.06); }
.start-menu-item .sm-icon { font-size: 18px; width: 26px; text-align: center; }
.start-menu-divider { height: 1px; background: rgba(255,255,255,0.08); margin: 4px 0; }

/* === PENCERE STİLİ === */
.module-frame {
  position: absolute;
  width: 520px;
  height: 400px;
  background-color: #f8f9fa;
  border: 1px solid rgba(0,0,0,0.15);
  border-radius: 10px;
  box-shadow: 0 10px 40px rgba(0,0,0,0.3);
  top: 60px;
  left: 60px;
  z-index: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transition: box-shadow 0.15s;
}

body.dark .module-frame { background-color: #1e1e1e; border-color: rgba(255,255,255,0.1); }

.module-frame.focused { box-shadow: 0 15px 50px rgba(0,0,0,0.45); }

.module-frame-resizer {
  position: absolute;
  width: 16px;
  height: 16px;
  z-index: 3;
}

.module-frame-resizer::before {
  content: '';
  position: absolute;
  width: 8px;
  height: 8px;
}

.module-frame-resizer.top-left {
  top: 0;
  left: 0;
  cursor: nwse-resize;
}

.module-frame-resizer.top-left::before {
  top: 3px;
  left: 3px;
  border-top: 2px solid rgba(60,89,152,0.55);
  border-left: 2px solid rgba(60,89,152,0.55);
}

.module-frame-resizer.top-right {
  top: 0;
  right: 0;
  cursor: nesw-resize;
}

.module-frame-resizer.top-right::before {
  top: 3px;
  right: 3px;
  border-top: 2px solid rgba(60,89,152,0.55);
  border-right: 2px solid rgba(60,89,152,0.55);
}

.module-frame-resizer.bottom-left {
  bottom: 0;
  left: 0;
  cursor: nesw-resize;
}

.module-frame-resizer.bottom-left::before {
  bottom: 3px;
  left: 3px;
  border-bottom: 2px solid rgba(60,89,152,0.55);
  border-left: 2px solid rgba(60,89,152,0.55);
}

.module-frame-resizer.bottom-right {
  right: 0;
  bottom: 0;
  cursor: nwse-resize;
}

.module-frame-resizer.bottom-right::before {
  right: 3px;
  bottom: 3px;
  border-right: 2px solid rgba(60,89,152,0.55);
  border-bottom: 2px solid rgba(60,89,152,0.55);
}

.module-frame-resizer.bottom {
  left: 50%;
  bottom: 0;
  width: 44px;
  height: 12px;
  transform: translateX(-50%);
  cursor: ns-resize;
}

.module-frame-resizer.bottom::before {
  left: 50%;
  bottom: 3px;
  width: 24px;
  height: 0;
  transform: translateX(-50%);
  border-bottom: 2px solid rgba(60,89,152,0.55);
}

.module-frame-resizer.left {
  left: 0;
  top: 50%;
  width: 12px;
  height: 44px;
  transform: translateY(-50%);
  cursor: ew-resize;
}

.module-frame-resizer.left::before {
  left: 3px;
  top: 50%;
  width: 0;
  height: 24px;
  transform: translateY(-50%);
  border-left: 2px solid rgba(60,89,152,0.55);
}

.module-frame-resizer.right {
  right: 0;
  top: 50%;
  width: 12px;
  height: 44px;
  transform: translateY(-50%);
  cursor: ew-resize;
}

.module-frame-resizer.right::before {
  right: 3px;
  top: 50%;
  width: 0;
  height: 24px;
  transform: translateY(-50%);
  border-right: 2px solid rgba(60,89,152,0.55);
}

body.dark .module-frame-resizer::before {
  border-color: rgba(255,255,255,0.4);
}

.module-frame-header {
  background: #3c5998;
  color: white;
  padding: 0 12px;
  cursor: move;
  display: flex;
  justify-content: space-between;
  align-items: center;
  user-select: none;
  border-radius: 10px 10px 0 0;
  height: 36px;
  flex-shrink: 0;
}

.module-frame-header .module-frame-title {
  font-size: 13px;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 6px;
}

.module-frame-header .controls { display: flex; gap: 7px; }

.module-frame-header .control {
  width: 13px;
  height: 13px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 8px;
  font-weight: bold;
  line-height: 1;
  color: transparent;
  transition: color 0.1s;
}

.module-frame-header .controls:hover .control { color: rgba(0,0,0,0.5); }
.module-frame-header .control:hover { color: rgba(0,0,0,0.8) !important; }

.close { background: #ff5f57; }
.minimize { background: #febc2e; }
.maximize { background: #28c840; }

.module-frame-content {
  flex: 1;
  overflow: auto;
  background-color: #fff;
}

body.dark .module-frame-content { background-color: #1e1e1e; color: #ddd; }

/* Snap overlay */
.snap-overlay {
  display: none;
  position: absolute;
  background: rgba(100,181,246,0.2);
  border: 2px solid rgba(100,181,246,0.5);
  border-radius: 8px;
  z-index: 99;
  pointer-events: none;
  transition: all 0.15s;
}

/* Pencere animasyonları */
@keyframes moduleFrameOpen { from { opacity: 0; transform: scale(0.92); } to { opacity: 1; transform: scale(1); } }
@keyframes moduleFrameClose { from { opacity: 1; transform: scale(1); } to { opacity: 0; transform: scale(0.92); } }
.module-frame.opening { animation: moduleFrameOpen 0.2s ease-out; }

/* Bildirim paneli */
.notification-panel {
  display: none;
  position: fixed;
  top: 52px;
  right: 10px;
  width: 340px;
  max-height: 440px;
  background: rgba(25,25,40,0.97);
  backdrop-filter: blur(20px);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 10px;
  box-shadow: 0 10px 40px rgba(0,0,0,0.6);
  z-index: 200;
  padding: 0;
  overflow-y: auto;
}

.notif-header {
  padding: 14px 16px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
  color: #fff;
  font-weight: 600;
  font-size: 14px;
}

.notif-item {
  padding: 12px 16px;
  border-bottom: 1px solid rgba(255,255,255,0.04);
  display: flex;
  gap: 10px;
  cursor: pointer;
  transition: background 0.1s;
}

.notif-item:hover { background: rgba(255,255,255,0.04); }
.notif-item .ni-icon { font-size: 20px; flex-shrink: 0; }
.notif-item .ni-body { flex: 1; }
.notif-item .ni-title { font-size: 13px; color: #fff; font-weight: 500; }
.notif-item .ni-desc { font-size: 12px; color: rgba(255,255,255,0.5); margin-top: 2px; }
.notif-item .ni-time { font-size: 11px; color: rgba(255,255,255,0.3); margin-top: 3px; }

/* === ERP İÇERİK STİLLERİ === */
.erp-toolbar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  background: #f8f9fa;
  border-bottom: 1px solid #e8e8e8;
  flex-wrap: wrap;
  flex-shrink: 0;
}

body.dark .erp-toolbar { background: #252525; border-color: #333; }

.erp-toolbar h3 { font-size: 14px; font-weight: 600; margin-right: auto; }

.erp-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 5px 12px;
  border: none;
  border-radius: 5px;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  font-family: inherit;
  transition: all 0.15s;
}

.erp-btn-primary { background: #3c5998; color: #fff; }
.erp-btn-primary:hover { background: #4a6baf; }
.erp-btn-success { background: #2e7d32; color: #fff; }
.erp-btn-success:hover { background: #388e3c; }
.erp-btn-danger { background: #c62828; color: #fff; }
.erp-btn-danger:hover { background: #d32f2f; }
.erp-btn-outline { background: #fff; color: #555; border: 1px solid #d0d5dd; }
.erp-btn-outline:hover { background: #f5f5f5; }

body.dark .erp-btn-outline { background: #333; color: #ccc; border-color: #555; }

.erp-filter {
  padding: 5px 8px;
  border: 1px solid #d0d5dd;
  border-radius: 5px;
  font-size: 12px;
  outline: none;
  background: #fff;
  font-family: inherit;
}

body.dark .erp-filter { background: #333; color: #ccc; border-color: #555; }

.erp-filter[multiple] {
  min-height: 96px;
  padding: 8px 10px;
  appearance: auto;
  -webkit-appearance: auto;
  background-image: none;
}

.erp-body { padding: 14px; overflow: auto; flex: 1; }

/* Dashboard stat kartları */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}

.stat-card {
  background: #fff;
  border: 1px solid #e8e8e8;
  border-radius: 8px;
  padding: 14px;
  display: flex;
  align-items: center;
  gap: 10px;
  transition: transform 0.15s;
}

body.dark .stat-card { background: #2a2a2a; border-color: #444; }

.stat-card:hover { transform: translateY(-1px); }

.stat-icon {
  width: 40px; height: 40px;
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 20px;
  flex-shrink: 0;
  color: #fff;
}

.stat-info h4 { font-size: 18px; font-weight: 700; line-height: 1; }
.stat-info p { font-size: 11px; color: #888; margin-top: 2px; }

.stat-change {
  font-size: 10px;
  padding: 1px 6px;
  border-radius: 8px;
  font-weight: 600;
  display: inline-block;
  margin-top: 2px;
}

.stat-up { background: #e8f5e9; color: #2e7d32; }
.stat-down { background: #ffebee; color: #c62828; }

/* Tablolar */
.erp-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}

.erp-table th {
  text-align: left;
  padding: 8px 10px;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: #888;
  font-weight: 600;
  border-bottom: 2px solid #e0e0e0;
  background: #fafafa;
}

body.dark .erp-table th { background: #252525; border-color: #444; color: #999; }

.erp-table td {
  padding: 8px 10px;
  border-bottom: 1px solid #f0f0f0;
}

body.dark .erp-table td { border-color: #333; }

.erp-table tr:hover td { background: #f8f9ff; }
body.dark .erp-table tr:hover td { background: #2a2a2a; }

.status {
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 10px;
  font-weight: 600;
  display: inline-block;
}

.status-ok { background: #e8f5e9; color: #2e7d32; }
.status-warn { background: #fff3e0; color: #e65100; }
.status-done { background: #f3e5f5; color: #7b1fa2; }
.status-bad { background: #ffebee; color: #c62828; }

/* Form */
.erp-form { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.erp-form.cols-1 { grid-template-columns: 1fr; }
.erp-form-group { display: flex; flex-direction: column; gap: 3px; }
.erp-form-group.full { grid-column: 1 / -1; }
.erp-form-group label { font-size: 11px; font-weight: 600; color: #666; }
body.dark .erp-form-group label { color: #aaa; }

.erp-form-group input,
.erp-form-group select,
.erp-form-group textarea {
  padding: 7px 9px;
  border: 1px solid #d0d5dd;
  border-radius: 5px;
  font-size: 13px;
  font-family: inherit;
  outline: none;
  transition: border 0.15s;
}

body.dark .erp-form-group input,
body.dark .erp-form-group select,
body.dark .erp-form-group textarea { background: #333; color: #eee; border-color: #555; }

.erp-form-group input:focus,
.erp-form-group select:focus,
.erp-form-group textarea:focus { border-color: #3c5998; }

.erp-form-group textarea { resize: vertical; min-height: 60px; }
.erp-form-actions { grid-column: 1 / -1; display: flex; gap: 6px; justify-content: flex-end; margin-top: 6px; }

/* Mini chart */
.mini-chart {
  display: flex;
  align-items: flex-end;
  gap: 3px;
  height: 50px;
}

.mini-chart .bar {
  flex: 1;
  background: #c5cae9;
  border-radius: 2px 2px 0 0;
  min-width: 6px;
  transition: background 0.15s;
}

.mini-chart .bar:hover { background: #3c5998; }

body.dark .mini-chart .bar { background: #3949ab; }
body.dark .mini-chart .bar:hover { background: #5c6bc0; }

/* Aktivite */
.activity-item {
  display: flex;
  gap: 10px;
  padding: 8px 0;
  border-bottom: 1px solid #f0f0f0;
  font-size: 12px;
}

body.dark .activity-item { border-color: #333; }

.activity-item:last-child { border-bottom: none; }
.activity-dot { width: 6px; height: 6px; border-radius: 50%; margin-top: 5px; flex-shrink: 0; }
.activity-time { font-size: 10px; color: #aaa; margin-top: 2px; }

/* Sayfalama */
.erp-pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 0;
  font-size: 11px;
  color: #888;
}

.erp-pagination button {
  padding: 3px 8px;
  border: 1px solid #ddd;
  background: #fff;
  border-radius: 3px;
  cursor: pointer;
  font-size: 11px;
  margin: 0 1px;
}

.erp-pagination button.active { background: #3c5998; color: #fff; border-color: #3c5998; }

/* Ayarlar toggle */
.toggle-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px solid #eee;
  font-size: 13px;
}

body.dark .toggle-row { border-color: #333; }

.toggle-switch {
  position: relative;
  width: 38px;
  height: 20px;
  background: #ccc;
  border-radius: 10px;
  cursor: pointer;
  transition: background 0.2s;
}

.toggle-switch.on { background: #3c5998; }

.toggle-switch::after {
  content: '';
  position: absolute;
  top: 2px; left: 2px;
  width: 16px; height: 16px;
  background: #fff;
  border-radius: 50%;
  transition: left 0.2s;
}

.toggle-switch.on::after { left: 20px; }

/* Kart */
.erp-card {
  background: #fff;
  border: 1px solid #e8e8e8;
  border-radius: 8px;
  overflow: hidden;
  margin-bottom: 10px;
}

body.dark .erp-card { background: #2a2a2a; border-color: #444; }

.erp-card-header {
  padding: 10px 14px;
  border-bottom: 1px solid #f0f0f0;
  font-size: 13px;
  font-weight: 600;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

body.dark .erp-card-header { border-color: #333; }

.erp-card-body { padding: 14px; }

/* Vendor entegrasyonlari */
.revenue-chart-wrap {
  position: relative;
  height: 168px;
}

#revenue-chart {
  width: 100% !important;
  height: 168px !important;
}

div.dt-container {
  font-size: 12px;
}

div.dt-container .dt-layout-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}

div.dt-container .dt-layout-cell {
  display: flex;
  align-items: center;
  gap: 8px;
}

div.dt-container .dt-input {
  min-width: 220px;
  padding: 6px 10px;
  border: 1px solid #d0d5dd;
  border-radius: 6px;
  font-size: 12px;
  outline: none;
}

div.dt-container .dt-info {
  font-size: 11px;
  color: #80889a;
}

div.dt-container .dt-paging .dt-paging-button {
  min-width: 30px;
  padding: 4px 8px;
  border: 1px solid #d0d5dd;
  border-radius: 6px;
  background: #fff;
  color: #465066 !important;
}

div.dt-container .dt-paging .dt-paging-button.current,
div.dt-container .dt-paging .dt-paging-button:hover {
  background: #3c5998 !important;
  border-color: #3c5998 !important;
  color: #fff !important;
}

body.dark div.dt-container .dt-input {
  background: #333;
  color: #eee;
  border-color: #555;
}

body.dark div.dt-container .dt-info,
body.dark div.dt-container .dt-length,
body.dark div.dt-container .dt-search {
  color: #b8bfd0;
}

body.dark div.dt-container .dt-paging .dt-paging-button {
  background: #2b2b2b;
  border-color: #444;
  color: #d7dbe7 !important;
}

.flatpickr-calendar {
  border: 1px solid #dbe2ea;
  border-radius: 12px;
  box-shadow: 0 18px 38px rgba(15, 23, 42, 0.16);
}

.flatpickr-day.selected,
.flatpickr-day.selected:hover,
.flatpickr-day.startRange,
.flatpickr-day.endRange {
  background: #3c5998;
  border-color: #3c5998;
}

body.dark .flatpickr-calendar {
  background: #242424;
  border-color: #444;
  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.4);
}

body.dark .flatpickr-months .flatpickr-month,
body.dark .flatpickr-weekdays,
body.dark span.flatpickr-weekday,
body.dark .flatpickr-current-month .flatpickr-monthDropdown-months,
body.dark .flatpickr-current-month input.cur-year,
body.dark .flatpickr-day,
body.dark .numInputWrapper span {
  color: #eef2ff;
  fill: #eef2ff;
}

body.dark .flatpickr-day.today {
  border-color: #8d9dff;
}

body.dark .flatpickr-day.selected,
body.dark .flatpickr-day.selected:hover {
  background: #8d9dff;
  border-color: #8d9dff;
  color: #111827;
}

.swal2-popup.erp-swal-popup {
  border-radius: 18px;
  padding: 1.25rem;
}

.swal-erp-form {
  display: grid;
  gap: 14px;
  margin-top: 10px;
  text-align: left;
}

.swal-erp-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.swal-erp-field label {
  font-size: 12px;
  font-weight: 600;
  color: #475569;
}

.erp-swal-popup .swal2-input,
.erp-swal-popup .swal2-select {
  width: 100%;
  height: 42px;
  margin: 0;
  padding: 0 12px;
  border: 1px solid #d0d5dd;
  border-radius: 10px;
  box-shadow: none;
  font-size: 13px;
}

.erp-swal-popup .swal2-select {
  padding-right: 36px;
}

.erp-swal-popup .swal2-actions {
  gap: 8px;
}

.erp-swal-popup .swal2-confirm {
  background: #3c5998;
}

.erp-swal-popup .swal2-cancel {
  background: #e5e7eb;
  color: #334155;
}

body.dark .swal2-popup.erp-swal-popup {
  background: #1f1f1f;
  color: #f3f4f6;
}

body.dark .swal-erp-field label {
  color: #d5d9e4;
}

body.dark .erp-swal-popup .swal2-input,
body.dark .erp-swal-popup .swal2-select {
  background: #2c2c2c;
  color: #f3f4f6;
  border-color: #454545;
}

body.dark .erp-swal-popup .swal2-cancel {
  background: #363636;
  color: #fff;
}

#toast-container {
  z-index: 20000;
}

#toast-container > div {
  border-radius: 12px;
  box-shadow: 0 18px 40px rgba(15, 23, 42, 0.24);
  opacity: 1;
}

/* Static HTML enterprise module surfaces */
.module-pane {
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 0;
  background: #edf2f8;
}

.module-toolbar {
  display: flex;
  align-items: stretch;
  justify-content: space-between;
  gap: 14px;
  padding: 12px;
  border-bottom: 1px solid #d5deeb;
  background: linear-gradient(180deg, #f8fafd 0%, #eef3f9 100%);
  box-shadow: 0 1px 0 rgba(208, 213, 221, 0.85), 0 4px 10px rgba(15, 23, 42, 0.05);
}

.module-toolbar__title {
  min-width: max-content;
  padding: 9px 12px;
  border-right: 1px solid #d7e0ef;
}

.module-toolbar__title h3 {
  margin: 0;
  font-size: 15px;
  font-weight: 700;
  color: #16253f;
}

.module-toolbar__title span {
  display: block;
  margin-top: 3px;
  font-size: 11px;
  color: #687a92;
}

.module-toolbar__filters {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 0 8px 10px;
  flex-wrap: wrap;
}

.module-search {
  width: 260px;
}

.module-body {
  flex: 1;
  min-height: 0;
  padding: 12px;
  overflow: auto;
}

.module-summary-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 12px;
}

.module-summary-card {
  padding: 12px 14px;
  border: 1px solid #d5deeb;
  border-radius: 6px;
  background: linear-gradient(180deg, #ffffff 0%, #f7f9fc 100%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.7);
}

.module-summary-card span {
  display: block;
  margin-bottom: 6px;
  font-size: 11px;
  font-weight: 700;
  color: #64758c;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.module-summary-card strong {
  display: block;
  font-family: "Segoe UI", Tahoma, Arial, sans-serif;
  font-size: 15px;
  line-height: 1.2;
  font-weight: 700;
  color: #152238;
  font-variant-numeric: tabular-nums;
}

.module-card {
  border: 1px solid #d5deeb;
  border-radius: 6px;
  overflow: hidden;
  box-shadow: none;
}

.module-table-wrap {
  overflow: auto;
}

.module-table {
  min-width: 920px;
  margin: 0;
  font-family: "Segoe UI", Tahoma, Arial, sans-serif;
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}

.module-table thead th {
  background: #6f89b3;
  border-bottom: 1px solid #5f79a7;
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
}

.module-table tbody tr:nth-child(odd) td {
  background: #fff;
}

.module-table tbody tr:nth-child(even) td {
  background: #f4f6fa;
}

.module-table tbody tr:hover td {
  background: #edf3fb;
}

.module-primary {
  font-weight: 700;
  color: #14233b;
}

.module-meta {
  margin-top: 3px;
  font-size: 11px;
  color: #6a7a90;
}

.module-stack {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.module-stack small {
  color: #6a7a90;
  font-size: 11px;
}

.module-number {
  text-align: center;
  white-space: nowrap;
}

.module-strong {
  font-weight: 700;
  color: #14233b;
}

.module-actions {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.module-action {
  min-width: 42px;
  min-height: 22px;
  padding: 0 8px;
  border: 1px solid #d7dde7;
  border-radius: 3px;
  background: linear-gradient(180deg, #ffffff 0%, #f3f5f8 100%);
  color: #4a5970;
  font-size: 11px;
  font-weight: 600;
  font-family: "Segoe UI", Tahoma, Arial, sans-serif;
  cursor: pointer;
}

.module-action:hover {
  border-color: #9fb0c9;
  background: linear-gradient(180deg, #ffffff 0%, #e9eef7 100%);
  color: #2f4d89;
}

body.dark .module-pane {
  background: #232932;
}

body.dark .module-toolbar {
  border-bottom-color: #404b5f;
  background: linear-gradient(180deg, #2f363f 0%, #262c34 100%);
  box-shadow: 0 1px 0 rgba(74, 85, 104, 0.92), 0 6px 12px rgba(0, 0, 0, 0.22);
}

body.dark .module-toolbar__title {
  border-color: #404b5f;
}

body.dark .module-toolbar__title h3,
body.dark .module-summary-card strong,
body.dark .module-primary,
body.dark .module-strong {
  color: #f5f8fc;
}

body.dark .module-toolbar__title span,
body.dark .module-meta,
body.dark .module-stack small,
body.dark .module-summary-card span {
  color: #a6b5c8;
}

body.dark .module-summary-card,
body.dark .module-card {
  border-color: #455264;
  background: linear-gradient(180deg, #333a44 0%, #2b313a 100%);
}

body.dark .module-table thead th {
  background: #5b7298;
  border-bottom-color: #506585;
}

body.dark .module-table tbody tr:nth-child(odd) td {
  background: #2d3440;
}

body.dark .module-table tbody tr:nth-child(even) td {
  background: #262d38;
}

body.dark .module-table tbody tr:hover td {
  background: #334055;
}

body.dark .module-table td {
  color: #f4f7fb;
}

body.dark .module-action {
  background: linear-gradient(180deg, #313844 0%, #28303a 100%);
  border-color: #455264;
  color: #d7dbe7;
}

body.dark .module-action:hover {
  background: linear-gradient(180deg, #384252 0%, #2d3644 100%);
  border-color: #7389ad;
  color: #fff;
}

.icon {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex-shrink: 0;
  display: inline-block;
  vertical-align: middle;
}

.start-btn .icon { width: 20px; height: 20px; }
.tray-icon .icon { width: 18px; height: 18px; }
.taskbar-logout .icon { width: 16px; height: 16px; }
.sm-icon .icon { width: 18px; height: 18px; }
.start-menu-item .sm-icon { display: inline-flex; align-items: center; justify-content: center; }
.ni-icon .icon { width: 20px; height: 20px; }
.notif-item .ni-icon { display: flex; align-items: center; justify-content: center; }
.stat-icon .icon { width: 22px; height: 22px; }
.stat-change .icon { width: 11px; height: 11px; }
.module-frame-title .icon { width: 14px; height: 14px; }
.module-frame-header .control .icon { width: 9px; height: 9px; stroke-width: 2.4; }
.context-menu .menu-item .icon { width: 14px; height: 14px; }
.context-menu .submenu-arrow .icon { width: 14px; height: 14px; }
.row-context-menu .ctx-item .icon { width: 14px; height: 14px; }
.btn-back .icon { width: 12px; height: 12px; margin-right: 2px; }
.erp-btn .icon { width: 13px; height: 13px; margin-right: 4px; }
.tab-item .icon { width: 13px; height: 13px; }

.desktop-icon .icon-img { font-size: 0; }
.desktop-icon .icon-img .icon { width: 28px; height: 28px; }
.desktop-icons.size-small .icon-img .icon { width: 22px; height: 22px; }
.desktop-icons.size-medium .icon-img .icon { width: 28px; height: 28px; }
.desktop-icons.size-large .icon-img .icon { width: 34px; height: 34px; }

.taskbar-logout .icon { width: 16px; height: 16px; }
.tab-close .icon { width: 10px; height: 10px; }
.tab-item .tab-close { display: inline-flex; align-items: center; }
.module-frame-header .control svg { pointer-events: none; }
.stat-icon { line-height: 0; }
.stat-change { display: inline-flex; align-items: center; gap: 3px; }
.module-frame-header .control .icon { opacity: 0; transition: opacity 0.15s; color: rgba(0,0,0,0.65); }
.module-frame-header .controls:hover .control .icon { opacity: 1; }