/* Vault — Tasarım Sistemi (design.md kurallarına tam sadık dark tema) */

:root {
  --bg: #0D1117;
  --surface: #161B22;
  --surface-raised: #1C2128;
  --border: #21262D;
  --text-primary: #E6EDF3;
  --text-secondary: #8B949E;
  --accent: #E8A33D; /* Amber */
  --accent-text: #0D1117;
  --success: #3FB950;
  --danger: #F85149;
  --radius: 8px;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  background-color: var(--bg);
  color: var(--text-primary);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  line-height: 1.5;
  font-size: 14px;
  min-height: 100vh;
}

/* Tipografi ve Monospace alanlar (IP, Port, Şifre, Kodlar) */
code, pre, .mono {
  font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
}

a {
  color: var(--accent);
  text-decoration: none;
}
a:hover {
  text-decoration: underline;
}

/* Layout */
.app-layout {
  display: flex;
  min-height: 100vh;
}

.sidebar {
  width: 260px;
  background-color: var(--surface);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
}

.sidebar-header {
  padding: 20px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 18px;
  font-weight: 700;
  color: var(--accent);
}

.nav-links {
  list-style: none;
  padding: 16px 8px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: var(--radius);
  color: var(--text-primary);
  font-weight: 500;
}
.nav-link:hover, .nav-link.active {
  background-color: var(--border);
  text-decoration: none;
}

.main-content {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.top-bar {
  height: 64px;
  background-color: var(--surface);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  gap: 20px;
}

.search-box {
  flex: 1;
  max-width: 480px;
  position: relative;
}

.search-input {
  width: 100%;
  background-color: var(--bg);
  border: 1px solid var(--border);
  color: var(--text-primary);
  padding: 8px 14px;
  border-radius: var(--radius);
  font-size: 14px;
  outline: none;
}
.search-input:focus {
  border-color: var(--accent);
}

.user-menu {
  display: flex;
  align-items: center;
  gap: 16px;
}

.content-body {
  padding: 24px;
  flex: 1;
  overflow-y: auto;
}

/* Kartlar ve Yüzeyler */
.card {
  background-color: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 20px;
}

.card-title {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 16px;
  color: var(--text-primary);
}

/* Tablolar */
.data-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}

.data-table th {
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
  color: var(--text-secondary);
  font-weight: 500;
  font-size: 13px;
}

.data-table td {
  padding: 14px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}

.data-table tr:hover td {
  background-color: rgba(255, 255, 255, 0.02);
}

/* Butonlar */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 8px 14px;
  border-radius: var(--radius);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  border: 1px solid transparent;
  transition: all 0.15s ease;
  min-height: 36px;
}

.btn-primary {
  background-color: var(--accent);
  color: var(--accent-text);
  font-weight: 600;
}
.btn-primary:hover {
  filter: brightness(1.08);
}

.btn-secondary {
  background-color: var(--surface-raised);
  border-color: var(--border);
  color: var(--text-primary);
}
.btn-secondary:hover {
  background-color: var(--border);
}

.btn-danger {
  background-color: transparent;
  border-color: var(--danger);
  color: var(--danger);
}
.btn-danger:hover {
  background-color: var(--danger);
  color: #fff;
}

.btn-sm {
  padding: 4px 8px;
  font-size: 12px;
  min-height: 28px;
}

/* Kısıtlı Cihaz Rozeti */
.badge-restricted {
  border: 1px solid var(--accent);
  color: var(--accent);
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

/* Formlar ve Girdi Bileşenleri (Modern Dark SaaS Tasarımı) */
.form-group {
  margin-bottom: 16px;
  display: flex;
  flex-direction: column;
}

.form-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 8px;
  white-space: nowrap;
}

.form-label span.hint {
  font-weight: 400;
  font-size: 11px;
  color: #6e7681;
}

.form-control {
  width: 100% !important;
  height: 44px !important;
  min-height: 44px !important;
  background-color: var(--bg) !important;
  border: 1px solid var(--border) !important;
  border-radius: var(--radius) !important;
  color: var(--text-primary) !important;
  padding: 0 14px !important;
  font-size: 14px !important;
  font-family: inherit !important;
  outline: none !important;
  box-sizing: border-box !important;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, background-color 0.15s ease !important;
}

.form-control:focus {
  border-color: var(--accent) !important;
  box-shadow: 0 0 0 3px rgba(232, 163, 61, 0.18) !important;
  background-color: #12161d !important;
}

.form-control::placeholder {
  color: #484f58;
}

textarea.form-control {
  height: auto !important;
  min-height: 84px !important;
  padding: 10px 14px !important;
  resize: vertical;
}

select.form-control {
  cursor: pointer;
  background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%238B949E' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 16px;
  padding-right: 36px !important;
  appearance: none;
}

/* Chrome ve Safari Autofill sarı zeminini yok etme */
input:-webkit-autofill,
input:-webkit-autofill:hover, 
input:-webkit-autofill:focus,
textarea:-webkit-autofill,
select:-webkit-autofill {
  -webkit-text-fill-color: var(--text-primary) !important;
  -webkit-box-shadow: 0 0 0px 1000px #0D1117 inset !important;
  transition: background-color 5000s ease-in-out 0s;
}

/* Modal (Pencereler) */
.modal-overlay {
  position: fixed;
  inset: 0;
  background-color: rgba(0, 0, 0, 0.78);
  backdrop-filter: blur(5px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 20px;
  overflow-y: auto;
}

.modal {
  background-color: var(--surface);
  border: 1px solid #30363d;
  border-radius: 12px;
  width: 100%;
  max-width: 540px;
  padding: 26px;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.6);
  animation: modalScale 0.15s ease-out;
  margin: auto;
}

.modal-lg {
  max-width: 660px;
}

@keyframes modalScale {
  from { transform: scale(0.96); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border);
}

.modal-header h3 {
  font-size: 18px;
  font-weight: 700;
  color: var(--accent);
}

/* Toast Bildirimi */
#toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  z-index: 2000;
}

.toast {
  background-color: var(--surface-raised);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 18px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
  font-size: 13px;
  color: var(--text-primary);
  animation: slideIn 0.2s ease-out;
}

@keyframes slideIn {
  from { transform: translateY(10px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

/* Mobil ve Tablet Uyumu (Sahada Kolay Kullanım) */
@media (max-width: 768px) {
  .app-layout {
    flex-direction: column;
  }
  .sidebar {
    width: 100%;
    border-right: none;
    border-bottom: 1px solid var(--border);
  }
  .top-bar {
    padding: 0 16px;
  }
  .content-body {
    padding: 16px;
  }
  .data-table {
    display: block;
    overflow-x: auto;
  }
  /* Mobilde dokunma alanını büyüt */
  .btn {
    min-height: 44px;
    padding: 10px 16px;
  }
}
