/* Ustalar modülü - Karşılama ile aynı tema */
@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700&display=swap');

:root {
  --bg-sidebar: #0f172a;
  --bg-sidebar-hover: #1e293b;
  --bg-page: #f8fafc;
  --bg-card: #ffffff;
  --text-primary: #0f172a;
  --text-secondary: #64748b;
  --text-inverse: #f1f5f9;
  --accent: #14b8a6;
  --accent-hover: #0d9488;
  --success: #10b981;
  --danger: #ef4444;
  --border: #e2e8f0;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 1px 3px rgba(15, 23, 42, 0.08);
  --font: 'Plus Jakarta Sans', system-ui, sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: var(--font);
  font-size: 15px;
  color: var(--text-primary);
  background: var(--bg-page);
  line-height: 1.5;
}

/* Giriş */
.login-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #0f172a 0%, #1e293b 50%, #334155 100%);
  padding: 1rem;
}

.login-card {
  width: 100%;
  max-width: 400px;
  background: var(--bg-card);
  border-radius: var(--radius);
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
  padding: 2rem;
}

.login-card h1 {
  margin: 0 0 0.5rem;
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-primary);
}

.login-card .sub {
  color: var(--text-secondary);
  margin-bottom: 1.5rem;
  font-size: 0.9375rem;
}

.login-card label {
  display: block;
  font-weight: 500;
  margin-bottom: 0.375rem;
  color: var(--text-primary);
}

.login-card input[type="text"],
.login-card input[type="password"] {
  width: 100%;
  padding: 0.75rem 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-family: var(--font);
  font-size: 1rem;
  margin-bottom: 1rem;
}

.login-card input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(20, 184, 166, 0.2);
}

.login-card .btn {
  width: 100%;
  padding: 0.875rem;
}

.login-card a {
  color: var(--accent);
  text-decoration: none;
}

.login-card a:hover {
  text-decoration: underline;
}

/* Layout */
.app-layout {
  display: flex;
  min-height: 100vh;
}

.sidebar {
  width: 260px;
  background: var(--bg-sidebar);
  color: var(--text-inverse);
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
}

.sidebar-brand {
  padding: 1.25rem 1.5rem;
  font-weight: 700;
  font-size: 1.125rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.sidebar-nav {
  flex: 1;
  padding: 1rem 0;
}

.sidebar-nav a {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1.5rem;
  color: rgba(241, 245, 249, 0.85);
  text-decoration: none;
  font-weight: 500;
  transition: background 0.15s, color 0.15s;
}

.sidebar-nav a:hover {
  background: var(--bg-sidebar-hover);
  color: #fff;
}

.sidebar-nav a.active {
  background: rgba(20, 184, 166, 0.2);
  color: #fff;
  border-left: 3px solid var(--accent);
  padding-left: calc(1.5rem - 3px);
}

.sidebar-nav .icon {
  font-size: 1.25rem;
  opacity: 0.9;
}

.sidebar-user {
  padding: 1rem 1.5rem;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  font-size: 0.875rem;
  color: rgba(241, 245, 249, 0.7);
}

.sidebar-user a {
  color: var(--accent);
  text-decoration: none;
}

.sidebar-user a:hover {
  text-decoration: underline;
}

.main {
  flex: 1;
  overflow-x: hidden;
  padding: 1.5rem;
}

.page-header {
  margin-bottom: 1.5rem;
}

.page-header h1 {
  margin: 0;
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-primary);
}

.page-header p {
  margin: 0.25rem 0 0;
  color: var(--text-secondary);
  font-size: 0.9375rem;
}

/* Kartlar */
.card {
  background: var(--bg-card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
  overflow: hidden;
  margin-bottom: 1.5rem;
}

.card-header {
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--border);
  font-weight: 600;
  font-size: 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.branch-card .card-header {
  background: #f0fdfa;
  border-bottom-color: rgba(20, 184, 166, 0.2);
}

.branch-name {
  color: var(--text-primary);
}

.branch-count {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-secondary);
  background: rgba(20, 184, 166, 0.12);
  color: #0d9488;
  padding: 0.35rem 0.75rem;
  border-radius: 9999px;
}

.card-body {
  padding: 1.25rem;
}

/* Form elemanları (genel) */
.form-group {
  margin-bottom: 1rem;
}

.form-group label {
  display: block;
  font-weight: 600;
  margin-bottom: 0.4rem;
  color: var(--text-primary);
}

.form-control {
  width: 100%;
  min-height: 42px;
  padding: 0.6rem 0.85rem;
  border: 1px solid var(--border);
  border-radius: 14px;
  font-family: var(--font);
  font-size: 0.9375rem;
  color: var(--text-primary);
  background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
  transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
}

.form-control:hover {
  border-color: #cbd5e1;
  background: #ffffff;
}

.form-control:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 4px rgba(20, 184, 166, 0.15);
  background: #ffffff;
}

select.form-control {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  border-radius: 14px;
  overflow: hidden;
  padding-right: 2.2rem;
  background-image:
    linear-gradient(45deg, transparent 50%, #64748b 50%),
    linear-gradient(135deg, #64748b 50%, transparent 50%),
    linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
  background-position:
    calc(100% - 16px) calc(50% - 2px),
    calc(100% - 11px) calc(50% - 2px),
    0 0;
  background-size: 5px 5px, 5px 5px, 100% 100%;
  background-repeat: no-repeat;
}

select.form-control option {
  font-family: var(--font);
  font-size: 0.9375rem;
  color: var(--text-primary);
  background: #ffffff;
  padding: 0.5rem 0.75rem;
}

select.form-control option:checked {
  background: #e0f2fe;
  color: #075985;
}

select.form-control option:hover {
  background: #f0fdfa;
}

textarea.form-control {
  min-height: 84px;
  resize: vertical;
}

/* ====== SAYFA BAŞLIĞI ====== */
.admin-header, .usta-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1.5rem;
  margin-bottom: 1.5rem;
  padding: 1.5rem 1.75rem;
  background: linear-gradient(135deg, #0f172a 0%, #1e293b 60%, #0d4f47 100%);
  border-radius: var(--radius);
  color: #f1f5f9;
}

.admin-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: rgba(20, 184, 166, 0.25);
  border: 1px solid rgba(20, 184, 166, 0.4);
  color: #5eead4;
  font-size: 0.78rem;
  font-weight: 700;
  padding: 0.3rem 0.75rem;
  border-radius: 9999px;
  letter-spacing: 0.04em;
  margin-bottom: 0.5rem;
}

.admin-header-info h1, .usta-header-info h1 {
  margin: 0 0 0.35rem;
  font-size: 1.5rem;
  font-weight: 800;
  color: #fff;
}

.admin-header-info p, .usta-header-info p {
  margin: 0;
  color: rgba(241, 245, 249, 0.65);
  font-size: 0.9rem;
}

/* İş akışı adımları */
.workflow-steps {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-shrink: 0;
}

.wf-step {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.35rem;
  min-width: 64px;
}

.wf-icon {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.07);
  border: 2px solid rgba(255, 255, 255, 0.12);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  transition: all 0.2s;
}

.wf-label {
  font-size: 0.7rem;
  font-weight: 600;
  color: rgba(241, 245, 249, 0.45);
  text-align: center;
  white-space: nowrap;
}

.wf-step.done .wf-icon {
  background: rgba(16, 185, 129, 0.2);
  border-color: rgba(16, 185, 129, 0.5);
}

.wf-step.done .wf-label { color: #6ee7b7; }

.wf-step.active .wf-icon {
  background: rgba(20, 184, 166, 0.3);
  border-color: #14b8a6;
  box-shadow: 0 0 0 4px rgba(20, 184, 166, 0.2);
}

.wf-step.active .wf-label {
  color: #5eead4;
  font-weight: 700;
}

.wf-arrow {
  color: rgba(241, 245, 249, 0.25);
  font-size: 1rem;
  margin-top: -12px;
}

@media (max-width: 768px) {
  .admin-header, .usta-header { flex-direction: column; }
  .workflow-steps { overflow-x: auto; padding-bottom: 0.25rem; }
}

/* ====== USTA YÖNETİM BÖLÜMÜ ====== */
.master-mgmt-section {
  display: grid;
  grid-template-columns: 1fr 380px;
  gap: 1.5rem;
  margin-bottom: 1.5rem;
  align-items: start;
}

@media (max-width: 900px) {
  .master-mgmt-section { grid-template-columns: 1fr; }
}

/* Usta listesi kartı */
.master-list-card {
  background: var(--bg-card);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.master-list-header {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--border);
  background: linear-gradient(135deg, #f0fdfa 0%, #e6fffa 100%);
}

.master-list-header-icon {
  font-size: 2rem;
  width: 52px;
  height: 52px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(20, 184, 166, 0.15);
  border-radius: 14px;
}

.master-list-title {
  font-weight: 700;
  font-size: 1rem;
  color: var(--text-primary);
}

.master-list-sub {
  font-size: 0.82rem;
  color: var(--text-secondary);
  margin-top: 2px;
}

.master-empty {
  padding: 2rem;
  text-align: center;
  color: var(--text-secondary);
  font-size: 0.9rem;
}

.master-table-wrap { overflow-x: auto; }

.master-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

.master-table th,
.master-table td {
  padding: 0.75rem 1.25rem;
  text-align: left;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}

.master-table th {
  font-weight: 600;
  font-size: 0.75rem;
  color: var(--text-secondary);
  background: #f8fafc;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.master-table tr:last-child td { border-bottom: none; }
.master-table tr:hover td { background: #f0fdfa; }

/* Avatar + isim (flex wrapper içinde) */
.master-row-identity {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.master-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: linear-gradient(135deg, #14b8a6, #0d9488);
  color: #fff;
  font-weight: 700;
  font-size: 0.9rem;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.master-fullname {
  font-weight: 500;
  color: var(--text-primary);
  white-space: nowrap;
}

.master-username {
  font-family: 'Courier New', monospace;
  font-size: 0.82rem;
  background: #f1f5f9;
  padding: 2px 7px;
  border-radius: 6px;
  color: #334155;
}

.master-branch-badge {
  display: inline-block;
  padding: 0.2rem 0.6rem;
  font-size: 0.75rem;
  font-weight: 600;
  border-radius: 9999px;
  background: rgba(20, 184, 166, 0.12);
  color: #0d9488;
  white-space: nowrap;
}

.master-branch-badge.sm {
  font-size: 0.72rem;
  padding: 0.15rem 0.5rem;
}

.master-no-branch { color: var(--text-secondary); }

.master-date {
  font-size: 0.82rem;
  color: var(--text-secondary);
  white-space: nowrap;
}

/* Usta ekleme form kartı */
.master-add-card {
  background: linear-gradient(155deg, #0f172a 0%, #1e293b 60%, #0d4f47 100%);
  border-radius: var(--radius);
  border: 1px solid rgba(20, 184, 166, 0.25);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.18);
  overflow: hidden;
}

.master-add-card-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1.25rem 1.5rem 1rem;
  font-weight: 700;
  font-size: 1rem;
  color: #f1f5f9;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.master-add-icon { font-size: 1.25rem; }

.master-add-form {
  display: flex;
  flex-direction: column;
  gap: 0.875rem;
  padding: 1.25rem 1.5rem 1.5rem;
}

.master-add-form .form-group { margin-bottom: 0; }

.master-add-form .form-group label {
  color: rgba(241, 245, 249, 0.85);
  font-size: 0.85rem;
  font-weight: 500;
  margin-bottom: 0.35rem;
}

.hint-label {
  font-weight: 400;
  font-size: 0.78rem;
  color: rgba(241, 245, 249, 0.5);
}

.master-add-form .form-control {
  background: rgba(255, 255, 255, 0.07);
  border-color: rgba(255, 255, 255, 0.12);
  color: #f1f5f9;
}

.master-add-form .form-control::placeholder { color: rgba(241, 245, 249, 0.35); }

.master-add-form .form-control:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(20, 184, 166, 0.25);
  background: rgba(255, 255, 255, 0.1);
  color: #f1f5f9;
}

.master-add-form select.form-control option {
  background: #1e293b;
  color: #f1f5f9;
}

/* Şifre toggle */
.password-input-wrap {
  position: relative;
  display: flex;
}

.password-input-wrap .form-control {
  padding-right: 3rem;
  flex: 1;
}

.password-toggle {
  position: absolute;
  right: 0;
  top: 0;
  height: 100%;
  padding: 0 0.75rem;
  background: transparent;
  border: none;
  cursor: pointer;
  font-size: 1rem;
  color: rgba(241, 245, 249, 0.5);
  transition: color 0.15s;
}

.password-toggle:hover { color: rgba(241, 245, 249, 0.9); }

.master-submit-btn {
  background: linear-gradient(135deg, #14b8a6, #0d9488);
  color: #fff;
  border: none;
  padding: 0.85rem 1.25rem;
  border-radius: 12px;
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
  transition: opacity 0.2s, transform 0.15s;
  margin-top: 0.25rem;
  width: 100%;
}

.master-submit-btn:hover {
  opacity: 0.9;
  transform: translateY(-1px);
}

/* Araç listesindeki atanan usta */
.assigned-usta-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.2rem 0.65rem;
  background: rgba(99, 102, 241, 0.12);
  color: #4338ca;
  border-radius: 9999px;
  font-size: 0.78rem;
  font-weight: 600;
  white-space: nowrap;
}

.no-usta {
  color: var(--text-secondary);
  font-size: 0.85rem;
}

/* İş tamamlama bildirimi */
.work-completion-notice {
  display: flex;
  align-items: center;
  gap: 0.875rem;
  margin-top: 1rem;
  padding: 0.875rem 1rem;
  background: linear-gradient(135deg, #f0fdf4, #dcfce7);
  border: 1px solid #86efac;
  border-radius: 12px;
  animation: slideIn 0.4s ease;
}

@keyframes slideIn {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

.completion-icon { font-size: 1.5rem; }

.completion-text {
  font-size: 0.875rem;
  color: #166534;
  line-height: 1.4;
}

/* Tablo */
.table-wrap {
  overflow-x: auto;
}

table.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9375rem;
}

table.data-table th,
table.data-table td {
  padding: 0.75rem 1rem;
  text-align: left;
  border-bottom: 1px solid var(--border);
}

table.data-table th {
  font-weight: 600;
  color: var(--text-secondary);
  background: #f8fafc;
  white-space: nowrap;
}

table.data-table tr:hover td {
  background: #f8fafc;
}

.vehicle-work-row {
  cursor: pointer;
}

.vehicle-work-row:hover td {
  background: #ccfbf1 !important;
}

.work-status-badge {
  display: inline-block;
  padding: 0.25rem 0.6rem;
  font-size: 0.75rem;
  font-weight: 600;
  border-radius: 9999px;
}

.work-status-beklemede {
  background: #fef3c7;
  color: #b45309;
}

.work-status-tamamlandi {
  background: #d1fae5;
  color: #047857;
}

/* Araç iş popup */
.vehicle-work-modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s ease, visibility 0.2s ease;
}

.vehicle-work-modal.vehicle-work-modal-open {
  opacity: 1;
  visibility: visible;
}

.vehicle-work-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.5);
}

.vehicle-work-box {
  position: relative;
  width: 100%;
  max-width: 560px;
  max-height: 90vh;
  overflow: hidden;
  background: var(--bg-card);
  border-radius: 16px;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
  display: flex;
  flex-direction: column;
}

.vehicle-work-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--border);
  background: #f0fdfa;
}

.vehicle-work-header h2 {
  margin: 0;
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--text-primary);
}

.vehicle-work-close {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  line-height: 1;
  color: var(--text-secondary);
  background: none;
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
}

.vehicle-work-close:hover {
  background: var(--border);
  color: var(--text-primary);
}

.vehicle-work-body {
  padding: 1.25rem;
  overflow-y: auto;
  flex: 1;
}

.vehicle-work-loading {
  text-align: center;
  padding: 2rem;
  color: var(--text-secondary);
}

.vehicle-work-detail {
  margin-bottom: 1.25rem;
}

.vehicle-work-section-title {
  margin: 0 0 0.75rem;
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--text-secondary);
}

.vehicle-work-detail-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem 1rem;
  font-size: 0.9375rem;
}

.vehicle-work-detail-grid .label {
  display: block;
  font-size: 0.75rem;
  color: var(--text-secondary);
  margin-bottom: 0.15rem;
}

.vehicle-work-detail-grid .value {
  color: var(--text-primary);
}

.vehicle-work-detail-grid .full {
  grid-column: 1 / -1;
}

.vehicle-work-form .form-group {
  margin-bottom: 1rem;
}

.vehicle-work-form .form-group label {
  display: block;
  font-weight: 500;
  margin-bottom: 0.35rem;
  font-size: 0.9375rem;
}

.vehicle-work-form .form-control {
  width: 100%;
  padding: 0.5rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-family: var(--font);
  font-size: 0.9375rem;
}

.vehicle-work-form textarea.form-control {
  resize: vertical;
  min-height: 60px;
}

.vehicle-work-actions {
  margin-top: 1rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.vehicle-work-saved {
  font-size: 0.875rem;
  color: var(--success);
  font-weight: 500;
}

.vehicle-work-error {
  color: var(--danger);
  margin: 0;
}

/* Boş durum */
.empty-state {
  text-align: center;
  padding: 2rem 1.5rem;
  color: var(--text-secondary);
}

.empty-state p {
  margin: 0;
}

/* Uyarılar & Butonlar */
.alert {
  padding: 0.75rem 1rem;
  border-radius: var(--radius-sm);
  margin-bottom: 1rem;
  font-size: 0.9375rem;
}

.alert-danger {
  background: #fef2f2;
  color: var(--danger);
  border: 1px solid #fecaca;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem 1.25rem;
  font-family: var(--font);
  font-weight: 600;
  font-size: 0.9375rem;
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  background: var(--accent);
  color: white;
}

.btn:hover {
  background: var(--accent-hover);
}

@media (max-width: 768px) {
  .app-layout {
    flex-direction: column;
  }

  .sidebar {
    width: 100%;
    flex-direction: row;
    flex-wrap: wrap;
    padding: 0;
  }

  .sidebar-brand {
    width: 100%;
  }

  .sidebar-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 0;
    padding: 0;
  }

  .sidebar-nav a {
    flex: 1 1 auto;
    min-width: 120px;
    justify-content: center;
  }

  .main {
    padding: 1rem;
  }
}