/* === Reset === */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --bg-light: #f9f9f9;
  --text-light: #222;
  --bg-dark: #1a1a1a;
  --text-dark: #e0e0e0;

  --grid-bg: #ffffff;
  --grid-border: #dcdcdc;
  --grid-header-bg: #f5f5f5;
  --grid-header-text: #222;
  --grid-row-hover: #f0f6ff;
  --grid-row-selected: #e6f2ff;
  --grid-text: #222;
  --grid-muted: #888;
  --grid-input-bg: #fff;
  --grid-input-border: #ccc;
}

html, body {
  height: 100%;
}

body.light {
  background-color: var(--bg-light);
  color: var(--text-light);
}

body.dark {
  background-color: var(--bg-dark);
  color: var(--text-dark);
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  font-size: 16px;
  line-height: 1.6;
  background-color: #1a1a1a;
  color: #222;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;

  display: relative;

  min-height: 100vh;
  overflow-x: hidden;
  transition: background-color 0.3s ease, color 0.3s ease;
}

ashina {
  display: grid;
  width: 100%;
  min-height: 100vh;
}

ashina > scripts {
  display: none;
}

/* Button */
.ui-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35em;
  padding: 0.5em 1em;
  min-height: 36px;
  font-size: 0.93rem;
  line-height: 1.2;
  font-family: inherit;
  font-weight: 600;
  color: #fff;
  background-color: #3e3f4b; /* koyu gri-mor ton */
  border: 1px solid #565869; /* hafif kontrast */
  border-radius: 6px;
  cursor: pointer;
  text-align: center;
  text-decoration: none;
  transition: background-color 0.2s ease, transform 0.1s ease;
}

.ui-button:hover {
  background-color: #565869; /* hover’da biraz daha açık */
}

.ui-button:active {
  background-color: #2f303a;
  transform: scale(0.97); /* basma hissi */
}

.ui-button:disabled {
  background-color: #2a2b33;
  color: #888;
  border-color: #3a3b44;
  cursor: not-allowed;
}

.ui-button.link-button {
  background: transparent;
  border: 0;
  color: #c8c8c8;
  min-height: 28px;
  padding: 0.25em 0.4em;
  font-size: 0.88rem;
  font-weight: 500;
}

.ui-button.link-button:hover {
  background: transparent;
  color: #e0e0e0;
  text-decoration: underline;
}

.ui-button.link-button:active {
  transform: none;
}

/* Input */
.ui-input {
  all: unset;
  box-sizing: border-box;
  width: auto;
  padding: 0.6em 0.9em;
  font-size: 1rem;
  font-family: inherit;
  color: #e6e6e6;
  background-color: #1e1e1e;
  border: 1px solid #333;
  border-radius: 6px;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.ui-input:focus {
  outline: none;
  border-color: #4c8bf5;
  box-shadow: 0 0 0 2px rgba(76, 139, 245, 0.3);
}

.ui-input::placeholder {
  color: #777;
  opacity: 0.7;
}

/* Label */
.ui-label {
  display: inline-block;
  font-size: 0.95rem;
  font-weight: 500;
  color: #cfcfcf;
  margin: 0.4em;
  line-height: 1.4;
  user-select: text;
  transition: color 0.2s ease;
}

.ui-label.center {
	text-align: center;
}

.ui-label.left {
	text-align: left;
}

.ui-label.right {
	text-align: right;
}

/* Image */
.ui-image {
  display: block;
  max-width: 100%;
  height: auto;
  border-radius: 8px;
  object-fit: cover;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

/* Textarea */
.ui-textarea {
  width: 100%;
  padding: 0.75em 1em;
  font-size: 0.95rem;
  font-family: inherit;
  color: #e0e0e0;
  padding-bottom: 1em;
  padding-right: 1em;
  background-color: #1e1e1e;
  border: 1px solid #444;
  border-radius: 6px;
  resize: vertical;
  line-height: 1.5;
  cursor: auto;
  resize: none;
  transition: border-color 0.2s ease, background-color 0.2s ease;
}

.ui-textarea:focus {
  outline: none;
  border-color: #5e9eff;
  background-color: #252525;
}

.ui-textarea::-webkit-scrollbar {
  width: 12px;
  height: 12px;
}

.ui-textarea::-webkit-scrollbar-track {
  background-color: rgba(255, 255, 255, 0.05);
}

.ui-textarea::-webkit-scrollbar-thumb {
  background-color: rgba(160, 160, 160, 0.5);
  border-radius: 6px;
  border: 3px solid transparent;
  background-clip: padding-box;
  transition: background-color 0.2s ease;
}

.ui-textarea:hover::-webkit-scrollbar-thumb {
  background-color: rgba(200, 200, 200, 0.6);
}

/* Checkbox */
.ui-checkbox {
  appearance: none;
  width: 18px;
  height: 18px;
  border: 1px solid #444;
  border-radius: 4px;
  background-color: #1e1e1e;
  cursor: pointer;
  display: inline-block;
  vertical-align: middle;
  transition: border-color 0.2s ease, background-color 0.2s ease, transform 0.15s ease;
}

.ui-checkbox:hover {
  border-color: #666;
}

.ui-checkbox:focus {
  outline: none;
  border-color: #5e9eff;
  box-shadow: 0 0 0 2px rgba(94, 158, 255, 0.3);
}

.ui-checkbox:checked {
  background-color: #4c8bf5;
  border-color: #4c8bf5;
}

.ui-checkbox:checked::after {
  content: "";
  position: absolute;
  width: 5px;
  height: 10px;
  border: solid #fff;
  border-width: 0 2px 2px 0;
  transform: translate(5px, 2px) rotate(45deg);
}

/* Radio */
.ui-radio {
  appearance: none;
  width: 18px;
  height: 18px;
  border: 2px solid #444;
  border-radius: 50%;
  background-color: #1e1e1e;
  cursor: pointer;
  position: relative;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
}

.ui-radio:hover {
  border-color: #666;
}

.ui-radio:focus {
  outline: none;
  border-color: #5e9eff;
  box-shadow: 0 0 0 2px rgba(94, 158, 255, 0.3);
}

.ui-radio:checked {
  border-color: #4c8bf5;
  background-color: #1e1e1e;
}

.ui-radio:checked::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 8px;
  height: 8px;
  background-color: #4c8bf5;
  border-radius: 50%;
  transform: translate(-50%, -50%);
}

/* Profile */
.user-panel .ui-card {
  border: 1px solid #2a2a2a;
  border-radius: 10px;
  background-color: #1f1f1f;
}

.profile-header-card {
  border-left: 3px solid #565869;
}

.profile-stat-card {
  min-height: 84px;
  background-color: #202027;
}

.profile-form-card .ui-label,
.profile-side-card .ui-label {
  margin-left: 0;
  margin-right: 0;
}

.profile-form-card .ui-input {
  background-color: #1d1d1d;
  border-color: #333;
}

.profile-form-card .ui-input[readonly] {
  cursor: default;
  border-color: #2f2f2f;
  background-color: #1c1c1c;
}

.profile-actions-card {
  background-color: #1b1b1b;
}

.profile-side-card {
  border-left: 3px solid #3e3f4b;
}

@media (max-width: 1100px) {
  .profile-stats-row {
    grid-template-columns: 1fr;
  }

  .profile-main-grid {
    grid-template-columns: 1fr;
  }
}

/* Select */
.ui-select {
  all: unset;
  box-sizing: border-box;
  width: 100%;
  padding: 0.6em 0.9em;
  font-size: 1rem;
  font-family: inherit;
  color: #e6e6e6;
  background-color: #1e1e1e;
  border: 1px solid #333;
  border-radius: 6px;
  transition: border-color 0.2s, box-shadow 0.2s;
  appearance: none;
}

.ui-select:focus {
  outline: none;
  border-color: #4c8bf5;
  box-shadow: 0 0 0 2px rgba(76, 139, 245, 0.3);
}

.ui-select option {
  background-color: #1e1e1e;
  color: #e6e6e6;
}

/* Container */
.ui-container {
  position: relative;
  display: grid;
  align-content: baseline;
  box-sizing: border-box;
  padding: 1em;
  margin: 0;
  background-color: #1a1a1a;
  border: 1px solid #2a2a2a;
  border-radius: 8px;
  color: #e0e0e0;
  transition: background-color 0.2s ease, border-color 0.2s ease;
}

.ui-container.flex {
  display: flex;
  gap: 1em;
}

.ui-container.center {
  justify-content: center;
  align-items: center;
}

.ui-container.column {
  flex-direction: column;
}

.ui-container.scroll {
  overflow: auto;
}

.ui-container.shadow {
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
}

.ui-container-title {
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 0.75em;
  margin: 0.5em;
  color: #333;
}

.ui-container.dark .ui-container-title {
  color: #eee;
}

/* List */
.ui-list {
  display: flex;
  flex-direction: column;
  gap: 0.75em;
  padding: 0;
  margin: 0;
  list-style: none;
}

/* Card */
.ui-card {
  background-color: #1e1e1e;
  border: 1px solid #333;
  border-radius: 8px;
  padding: 1.2em;
  box-shadow: 0 2px 6px rgba(0,0,0,0.3);
  transition: box-shadow 0.2s ease, transform 0.2s ease;
}

.ui-card:hover {
  box-shadow: 0 4px 12px rgba(0,0,0,0.4);
  transform: translateY(-2px);
}

/* Modal */
.ui-modal {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 1000;
  background-color: #1e1e1e;
  border: 1px solid #444;
  border-radius: 8px;
  padding: 1.5em;
  box-shadow: 0 4px 12px rgba(0,0,0,0.5);
  width: 90%;
  max-width: 480px;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.ui-modal.hidden {
  display: none;
  opacity: 0;
}

/* Toast */
.ui-toast {
  position: fixed;
  background-color: #2a2a2a;
  color: #eee;
  padding: 0.8em 1.2em;
  border-radius: 6px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.4);
  font-size: 0.95rem;
  z-index: 999;
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.3s ease, transform 0.3s ease;
}

.ui-toast.show {
  opacity: 1;
  transform: translateY(0);
}

.ui-toast.top-left    { top: 1em; left: 1em; }
.ui-toast.top-center  { top: 1em; left: 50%; transform: translateX(-50%); }
.ui-toast.top-right   { top: 1em; right: 1em; }

.ui-toast.middle-left   { top: 50%; left: 1em; transform: translateY(-50%); }
.ui-toast.middle-center { top: 50%; left: 50%; transform: translate(-50%, -50%); }
.ui-toast.middle-right  { top: 50%; right: 1em; transform: translateY(-50%); }

.ui-toast.bottom-left   { bottom: 1em; left: 1em; }
.ui-toast.bottom-center { bottom: 1em; left: 50%; transform: translateX(-50%); }
.ui-toast.bottom-right  { bottom: 1em; right: 1em; }

/* Panel */
.ui-panel {
  background-color: #1a1a1a;
  border: 1px solid #2a2a2a;
  border-radius: 6px;
  padding: 1em;
  box-sizing: border-box;
  transition: border-color 0.2s ease, background-color 0.2s ease;
}

#ViewMain {
  position: relative;
  width: 100vw;
  height: 100vh;
  padding: 0;
  margin: 0;
  border: 0;
}

.register-form-row {
  display: flex;
  gap: 16px;
  align-items: flex-start;
}

.register-col {
  flex: 1 1 0;
  min-width: 0;
}

.register-actions {
  width: 100%;
  display: grid;
  place-items: center;
}

@media (max-width: 768px) {
  .register-form-row {
    flex-direction: column;
    gap: 8px;
  }

  .register-col {
    width: 100%;
  }
}

/* UL için: Menü kapsayıcısı */
.ui-menu {
  list-style: none;       /* varsayılan noktaları kaldır */
  margin: 0;
  padding: 0;
  display: flex;          /* yatay menü */
  gap: 1em;               /* seçenekler arası boşluk */
}

.ui-menu.vertical {
  flex-direction: column;
  align-items: flex-start;
}

/* LI için: Menü öğesi */
.ui-menu-item {
  padding: 0.5em 1em;
  cursor: pointer;
  border-radius: 4px;
  transition: background-color 0.3s ease, color 0.3s ease;
}

.ui-menu-item a {
  text-decoration: none;
  color: inherit;         /* parent rengini kullan */
  display: block;
}

/* Hover efekti */
.ui-menu-item:hover {
  background-color: #333;
  color: #fff;
}

.ui-menu-item.active {
  background-color: #555;
  color: #fff;
}

#ViewMenu {
  height: 100%;
  padding: 16px 12px;
  gap: 6px;
  align-items: stretch;
  background-color: #151515;
  border-right: 1px solid #2a2a2a;
  overflow-y: auto;
}

#ViewMenu.is-collapsed {
  display: none;
}

.main-menu-toggle {
  z-index: 50;
  width: 44px;
  height: 44px;
  padding: 0;
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  border: 1px solid #3a3a3a;
  border-radius: 10px;
  background: rgba(21, 21, 21, 0.94);
  box-shadow: 0 10px 22px rgba(0, 0, 0, 0.28);
  cursor: pointer;
  transition: background-color 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}

.main-menu-toggle.in-header {
  position: absolute;
  top: 50%;
  left: 14px;
  transform: translateY(-50%);
}

.main-menu-toggle:hover {
  background: rgba(38, 38, 38, 0.97);
  border-color: #4a4a4a;
}

.main-menu-toggle:focus-visible {
  outline: 2px solid #5e9eff;
  outline-offset: 2px;
}

.main-menu-toggle:active {
  transform: translateY(-50%) scale(0.96);
}

.main-menu-toggle-line {
  width: 18px;
  height: 2px;
  border-radius: 999px;
  background: #f3f3f3;
}

#ViewMenu .ui-image {
  align-self: center;
  width: 88px !important;
  height: 88px !important;
  border-radius: 9999px;
  object-fit: cover;
  object-position: center center;
  background-color: #1a1a1a;
  border: 1px solid #303030;
  padding: 0;
  margin-bottom: 10px;
  transform: scale(1.35);
  transform-origin: center center;
}

#ViewMenu .ui-label {
  width: 100%;
  text-align: center;
  font-weight: 600;
  margin: 0 0 10px 0;
}

#ViewMenu .ui-menu-item {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid transparent;
  border-radius: 6px;
}

#ViewMenu .ui-menu-item:hover {
  background-color: #2b2b2b;
  border-color: #3a3a3a;
}

#ViewMenu .ui-menu-item.active {
  background-color: #323232;
  border-color: #464646;
}

#ViewMenu .ui-menu-item:last-child {
  margin-top: auto;
}

#ViewHeader .header-icon-btn {
  font-size: 0.95rem;
  border-radius: 6px;
  position: relative;
}

#ViewHeader .header-search-btn {
  position: relative;
}

#ViewHeader .header-search-btn::before {
  content: "";
  position: absolute;
  width: 10px;
  height: 10px;
  border: 2px solid #d7d7d7;
  border-radius: 999px;
  top: 8px;
  left: 9px;
}

#ViewHeader .header-search-btn::after {
  content: "";
  position: absolute;
  width: 7px;
  height: 2px;
  border-radius: 999px;
  background: #d7d7d7;
  top: 19px;
  left: 18px;
  transform: rotate(45deg);
}

#ViewHeader {
  position: relative;
  padding-left: 64px !important;
}

#ViewHeader .header-icon-btn[data-badge]::after {
  content: attr(data-badge);
  position: absolute;
  top: -6px;
  right: -6px;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  border-radius: 9999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.65rem;
  font-weight: 700;
  line-height: 1;
  color: #fff;
  background: #d94b4b;
  border: 1px solid #1a1a1a;
}

@media (max-width: 1000px) {
  .main-menu-toggle.in-header {
    left: 10px;
  }
}

@media (max-width: 640px) {
  #ViewHeader .header-username {
    display: none;
  }
}

/* =====================================================
   GRID ROOT
===================================================== */

.ui-grid {
  display: flex;
  flex-direction: column;
  width: 100%;
  height: 100%;
  background: #1e1e1e;
  color: #e0e0e0;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 13px;
  border: 1px solid #2a2a2a;
  overflow: hidden;
  box-sizing: border-box;
}

/* =====================================================
   HEADER
===================================================== */

.ui-grid-header {
  display: flex;
  background: #252526;
  border-bottom: 1px solid #2a2a2a;
  user-select: none;
  padding: 0em;
}

.ui-grid-cell.header {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 6px 6px 4px;
  box-sizing: border-box;
  font-weight: 600;
  color: #dcdcdc;
  border-right: 1px solid #2a2a2a;
  background: inherit;
}

.ui-grid-cell.header:last-child {
  border-right: none;
}

.ui-grid-cell.header .ui-label {
  white-space: nowrap;
}

/* Search input */
.ui-grid-cell.header .ui-input {
  height: 22px;
  padding: 2px 4px;
  font-size: 12px;
  background: #1e1e1e;
  border: 1px solid #3a3a3a;
  color: #e0e0e0;
}

/* =====================================================
   BODY
===================================================== */

.ui-grid-body {
  position: relative;
  flex: 1;
  background: #1e1e1e;
  overflow-y: auto;
  overflow-x: hidden;
}

/* =====================================================
   ROW
===================================================== */

.ui-grid-row {
  position: absolute;
  display: flex;
  width: 100%;
  box-sizing: border-box;
  background: #1e1e1e;
  border-bottom: 1px solid #2a2a2a;
  transition: background 0.08s ease;
}

.ui-grid-row:hover {
  background: #2a2d2e;
}

.ui-grid-row.selected {
  background: #094771;
}

/* =====================================================
   CELL
===================================================== */

.ui-grid-cell {
  display: flex;
  align-items: center;
  padding: 4px 6px;
  box-sizing: border-box;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  border-right: 1px solid #2a2a2a;
  color: #e0e0e0;
}

.ui-grid-cell:last-child {
  border-right: none;
}

/* Checkbox alignment */
.ui-grid-cell .ui-checkbox {
  margin: auto;
}

/* =====================================================
   INLINE EDIT
===================================================== */

.ui-grid-cell .ui-input,
.ui-grid-cell select {
  width: 100%;
  height: 100%;
  padding: 2px 4px;
  background: #1e1e1e;
  border: 1px solid #3a3a3a;
  color: #e0e0e0;
  font-size: 13px;
  box-sizing: border-box;
}

/* =====================================================
   FOOTER / PAGINATION
===================================================== */

.ui-grid-footer {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 6px;
  background: #252526;
  border-top: 1px solid #2a2a2a;
  font-size: 12px;
  color: #c8c8c8;
  gap: 6px;
}

/* Pagination buttons */
.ui-grid-footer .ui-label {
  color: #c8c8c8;
}

.ui-grid-footer .ui-input {
  width: 48px;
  text-align: center;
  padding: 2px 4px;
}

.ui-grid-footer .ui-button {
  background: #3a3a3a;
  border: 1px solid #4a4a4a;
  color: #e0e0e0;
  padding: 0.4em 0.8em;
  font-size: 12px;
}

.ui-grid-footer .ui-button:hover {
  background: #505050;
}

/* =====================================================
   EMPTY STATE
===================================================== */

.ui-grid-empty {
  padding: 20px;
  text-align: center;
  color: #888;
}

/* ===============================
   GRID SELECTION OVERLAY
================================ */

.ui-grid-selection {
  position: absolute;
  left: 0;
  right: 0;
  background: rgba(76, 139, 245, 0.18);
  border: 2px solid #4c8bf5;
  pointer-events: none;
  z-index: 10;
  box-sizing: border-box;
}

.ui-grid-body,
.ui-grid-row,
.ui-grid-cell {
  user-select: text;
}

.ui-grid-row.selected {
  background: rgba(80, 140, 255, 0.25);
}

.ui-grid-row.selected .ui-grid-cell {
  background: transparent;
}