/* css/admin.css */

*, *::before, *::after { margin:0; padding:0; box-sizing:border-box; }

:root {
  --bg: #f0f3f8;
  --bg2: #ffffff;
  --text: #1a1d26;
  --text2: #5f6880;
  --primary: #1a5276;
  --primary-l: #2e86c1;
  --accent: #e67e22;
  --success: #27ae60;
  --danger: #e74c3c;
  --border: #e2e6ee;
  --shadow: 0 2px 16px rgba(0,0,0,0.06);
  --radius: 14px;
  --radius-sm: 8px;
  --font: 'Inter', system-ui, sans-serif;
  --transition: 0.25s ease;
}

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
}

/* Login */
.login-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 1rem;
}

.login-card {
  background: var(--bg2);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 2.5rem 2rem;
  width: 100%;
  max-width: 400px;
  text-align: center;
}

.login-card h1 {
  font-size: 1.3rem;
  margin-bottom: 0.3rem;
}

.login-card .login-sub {
  font-size: 0.85rem;
  color: var(--text2);
  margin-bottom: 1.5rem;
}

.login-card .form-group {
  text-align: left;
  margin-bottom: 1rem;
}

.login-card label {
  display: block;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text2);
  margin-bottom: 0.3rem;
}

.login-card input {
  width: 100%;
  padding: 0.75rem 1rem;
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 0.95rem;
  font-family: var(--font);
  transition: border-color 0.2s;
}

.login-card input:focus { outline: none; border-color: var(--primary-l); }

.login-card .btn-login {
  width: 100%;
  padding: 0.8rem;
  border: none;
  border-radius: var(--radius-sm);
  background: var(--primary);
  color: #fff;
  font-family: var(--font);
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.2s;
  margin-top: 0.5rem;
}

.login-card .btn-login:hover { background: var(--primary-l); }

.login-error {
  color: var(--danger);
  font-size: 0.82rem;
  margin-top: 0.75rem;
}

/* Admin Layout */
.admin-nav {
  background: var(--bg2);
  border-bottom: 1px solid var(--border);
  padding: 0 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 60px;
  position: sticky;
  top: 0;
  z-index: 100;
}

.admin-nav .an-brand {
  font-weight: 800;
  font-size: 1rem;
  color: var(--primary);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.admin-nav .an-right {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.an-right a, .an-right button {
  padding: 0.45rem 0.9rem;
  border-radius: var(--radius-sm);
  font-family: var(--font);
  font-size: 0.82rem;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.2s;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.btn-site {
  background: var(--bg);
  border: 1px solid var(--border);
  color: var(--text2);
}

.btn-site:hover { border-color: var(--primary-l); color: var(--primary-l); }

.btn-logout {
  background: var(--danger);
  border: none;
  color: #fff;
}

.btn-logout:hover { background: #c0392b; }

/* Admin Container */
.admin-container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 1.5rem;
}

/* Admin Tabs */
.admin-tabs {
  display: flex;
  gap: 0.4rem;
  margin-bottom: 1.5rem;
  background: var(--bg2);
  padding: 0.4rem;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.atab {
  flex: 1;
  padding: 0.7rem 0.5rem;
  border: none;
  background: transparent;
  font-family: var(--font);
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text2);
  cursor: pointer;
  border-radius: var(--radius-sm);
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
}

.atab.active {
  background: var(--primary);
  color: #fff;
}

.atab:hover:not(.active) { background: var(--bg); }

/* Admin Panels */
.admin-panel { display: none; }
.admin-panel.active { display: block; }

/* Card */
.acard {
  background: var(--bg2);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  margin-bottom: 1rem;
}

.acard-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--border);
}

.acard-header h2 {
  font-size: 1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.acard-body { padding: 1.25rem; }

/* Buttons */
.btn {
  padding: 0.55rem 1.1rem;
  border: none;
  border-radius: var(--radius-sm);
  font-family: var(--font);
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-l); }
.btn-success { background: var(--success); color: #fff; }
.btn-success:hover { background: #219a52; }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { background: #c0392b; }
.btn-warning { background: var(--accent); color: #fff; }
.btn-warning:hover { background: #cf6d17; }
.btn-sm { padding: 0.35rem 0.7rem; font-size: 0.78rem; }
.btn-outline {
  background: transparent;
  border: 2px solid var(--border);
  color: var(--text2);
}
.btn-outline:hover { border-color: var(--primary-l); color: var(--primary-l); }

/* Form */
.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-bottom: 1rem;
}

.form-group { margin-bottom: 1rem; }

.form-group label {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text2);
  margin-bottom: 0.35rem;
}

.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 0.65rem 0.9rem;
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  font-family: var(--font);
  color: var(--text);
  background: #fff;
  transition: border-color 0.2s;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--primary-l);
}

.form-group textarea { resize: vertical; min-height: 80px; }

.form-group .help-text {
  font-size: 0.72rem;
  color: var(--text2);
  margin-top: 0.25rem;
}

.color-input-wrap {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.color-input-wrap input[type="color"] {
  width: 44px;
  height: 38px;
  padding: 2px;
  border: 2px solid var(--border);
  border-radius: 6px;
  cursor: pointer;
}

.color-input-wrap input[type="text"] { flex: 1; }

/* Route List */
.route-list-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.85rem 1.25rem;
  border-bottom: 1px solid var(--border);
  transition: background 0.15s;
}

.route-list-item:last-child { border-bottom: none; }
.route-list-item:hover { background: var(--bg); }

.rli-color {
  width: 6px;
  height: 40px;
  border-radius: 3px;
  flex-shrink: 0;
}

.rli-info { flex: 1; }
.rli-info .rli-name { font-weight: 600; font-size: 0.92rem; }
.rli-info .rli-meta { font-size: 0.75rem; color: var(--text2); margin-top: 0.1rem; }

.rli-status {
  padding: 0.2rem 0.6rem;
  border-radius: 20px;
  font-size: 0.72rem;
  font-weight: 700;
}

.rli-status.active { background: #e8f8f0; color: var(--success); }
.rli-status.inactive { background: #fde8e8; color: var(--danger); }

.rli-actions { display: flex; gap: 0.35rem; }

/* Stops Editor */
.stops-editor {
  background: var(--bg);
  border-radius: var(--radius-sm);
  padding: 1rem;
  margin-top: 0.5rem;
}

.stops-editor h4 {
  font-size: 0.85rem;
  margin-bottom: 0.5rem;
  color: var(--text2);
}

.stop-list { list-style: none; }

.stop-list li {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.4rem 0;
}

.stop-list li .stop-num {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--primary-l);
  color: #fff;
  font-size: 0.7rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.stop-list li input {
  flex: 1;
  padding: 0.45rem 0.7rem;
  border: 2px solid var(--border);
  border-radius: 6px;
  font-size: 0.85rem;
  font-family: var(--font);
}

.stop-list li input:focus { outline: none; border-color: var(--primary-l); }

.stop-list li .btn-remove-stop {
  background: none;
  border: none;
  color: var(--danger);
  cursor: pointer;
  font-size: 0.85rem;
  opacity: 0.5;
  transition: opacity 0.2s;
}

.stop-list li .btn-remove-stop:hover { opacity: 1; }

.btn-add-stop {
  margin-top: 0.5rem;
  padding: 0.4rem 0.8rem;
  border: 2px dashed var(--border);
  border-radius: 6px;
  background: transparent;
  font-family: var(--font);
  font-size: 0.8rem;
  color: var(--text2);
  cursor: pointer;
  transition: all 0.2s;
  width: 100%;
}

.btn-add-stop:hover { border-color: var(--primary-l); color: var(--primary-l); }

/* Announcement List */
.ann-list-item {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 0.85rem 1.25rem;
  border-bottom: 1px solid var(--border);
}

.ann-list-item:last-child { border-bottom: none; }

.ann-type-badge {
  padding: 0.2rem 0.55rem;
  border-radius: 5px;
  font-size: 0.72rem;
  font-weight: 700;
  color: #fff;
  flex-shrink: 0;
  margin-top: 0.15rem;
}

.ann-type-badge.info { background: var(--primary-l); }
.ann-type-badge.warning { background: var(--accent); }

.ann-info { flex: 1; }
.ann-info .ann-title { font-weight: 600; font-size: 0.9rem; }
.ann-info .ann-text { font-size: 0.8rem; color: var(--text2); margin-top: 0.15rem; }
.ann-info .ann-date { font-size: 0.72rem; color: var(--text2); margin-top: 0.25rem; }

.ann-actions { display: flex; gap: 0.35rem; flex-shrink: 0; }

/* Modal */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 500;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s;
}

.modal-overlay.open { opacity: 1; pointer-events: auto; }

.modal {
  background: var(--bg2);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  width: 100%;
  max-width: 600px;
  max-height: 90vh;
  overflow-y: auto;
  transform: translateY(20px);
  transition: transform 0.25s;
}

.modal-overlay.open .modal { transform: translateY(0); }

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--border);
}

.modal-header h3 { font-size: 1rem; }

.modal-close {
  background: none;
  border: none;
  font-size: 1.2rem;
  color: var(--text2);
  cursor: pointer;
}

.modal-body { padding: 1.25rem; }
.modal-footer {
  padding: 1rem 1.25rem;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: flex-end;
  gap: 0.5rem;
}

/* Toast */
.toast-container {
  position: fixed;
  top: 80px;
  right: 1rem;
  z-index: 600;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.toast {
  padding: 0.75rem 1.25rem;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  font-weight: 600;
  color: #fff;
  box-shadow: var(--shadow);
  animation: toastIn 0.3s ease, toastOut 0.3s ease 2.7s forwards;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.toast.success { background: var(--success); }
.toast.error { background: var(--danger); }

@keyframes toastIn { from { opacity:0; transform:translateX(40px); } to { opacity:1; transform:translateX(0); } }
@keyframes toastOut { from { opacity:1; } to { opacity:0; transform:translateX(40px); } }

/* Responsive */
@media (max-width: 640px) {
  .form-row { grid-template-columns: 1fr; }
  .admin-tabs { flex-wrap: wrap; }
  .atab { font-size: 0.78rem; }
  .route-list-item { flex-wrap: wrap; }
  .rli-actions { width: 100%; justify-content: flex-end; }
}
/* css/admin.css — en alta ekle */

.stop-min-input {
  width: 65px !important;
  text-align: center;
  flex-shrink: 0;
}

.stop-min-input::placeholder {
  font-size: 0.75rem;
}