/* =====================================================
   OKAY OK — Private Application Interface
   Enterprise • Secure • Mobile-First
   ===================================================== */

:root {
  --priv-bg: #060912;
  --priv-surface: #0c1220;
  --priv-card: #111827;
  --priv-elevated: #1a2332;
  --priv-border: rgba(148, 163, 184, 0.1);
  --priv-accent: #3b82f6;
  --priv-accent-bright: #60a5fa;
  --priv-success: #10b981;
  --priv-warning: #f59e0b;
  --priv-danger: #ef4444;
  --priv-text: #f1f5f9;
  --priv-muted: #94a3b8;
  --priv-radius: 16px;
}

body.private-app {
  background: var(--priv-bg);
  color: var(--priv-text);
  min-height: 100vh;
  font-family: 'Inter', system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
}

/* ===== LOGIN SCREEN ===== */
.login-wrapper {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  position: relative;
  overflow: hidden;
}

.login-wrapper::before {
  content: '';
  position: absolute;
  width: 400px;
  height: 400px;
  background: radial-gradient(circle, rgba(59, 130, 246, 0.15), transparent 70%);
  top: -100px;
  right: -100px;
  pointer-events: none;
}

.login-wrapper::after {
  content: '';
  position: absolute;
  width: 300px;
  height: 300px;
  background: radial-gradient(circle, rgba(34, 211, 238, 0.08), transparent 70%);
  bottom: -80px;
  left: -80px;
  pointer-events: none;
}

.login-card {
  width: 100%;
  max-width: 400px;
  background: var(--priv-surface);
  border: 1px solid var(--priv-border);
  border-radius: 24px;
  padding: 40px 32px;
  position: relative;
  z-index: 1;
  box-shadow: 0 25px 50px rgba(0, 0, 0, 0.4);
}

.login-header {
  text-align: center;
  margin-bottom: 32px;
}

.login-logo {
  width: 56px;
  height: 56px;
  background: linear-gradient(135deg, #3b82f6, #22d3ee);
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 1.1rem;
  color: white;
  margin: 0 auto 20px;
  box-shadow: 0 0 30px rgba(59, 130, 246, 0.4);
}

.login-header h1 {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 8px;
  letter-spacing: -0.02em;
}

.login-header p {
  color: var(--priv-muted);
  font-size: 0.9rem;
  line-height: 1.5;
}

.secure-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  background: rgba(16, 185, 129, 0.1);
  border: 1px solid rgba(16, 185, 129, 0.2);
  border-radius: 100px;
  font-size: 0.75rem;
  color: #34d399;
  margin-bottom: 20px;
}

.login-form .form-group {
  margin-bottom: 18px;
}

.login-form label {
  display: block;
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--priv-muted);
  margin-bottom: 8px;
}

.login-form input {
  width: 100%;
  padding: 14px 16px;
  background: var(--priv-card);
  border: 1px solid var(--priv-border);
  border-radius: 12px;
  color: var(--priv-text);
  font-size: 1rem;
  min-height: 52px;
  transition: all 0.2s ease;
}

.login-form input:focus {
  border-color: var(--priv-accent);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2);
  outline: none;
}

.login-form input::placeholder {
  color: #64748b;
}

.btn-login {
  width: 100%;
  padding: 16px;
  background: linear-gradient(135deg, #3b82f6, #2563eb);
  color: white;
  font-weight: 600;
  font-size: 1rem;
  border-radius: 12px;
  border: none;
  cursor: pointer;
  min-height: 52px;
  margin-top: 8px;
  transition: all 0.2s ease;
  box-shadow: 0 4px 20px rgba(59, 130, 246, 0.3);
}

.btn-login:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 25px rgba(59, 130, 246, 0.4);
}

.btn-login:active {
  transform: translateY(0);
}

.login-footer {
  text-align: center;
  margin-top: 28px;
  padding-top: 20px;
  border-top: 1px solid var(--priv-border);
}

.login-footer p {
  font-size: 0.8rem;
  color: #64748b;
}

.login-footer a {
  color: var(--priv-accent-bright);
  text-decoration: none;
}

.error-msg {
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.25);
  color: #f87171;
  padding: 12px 14px;
  border-radius: 10px;
  font-size: 0.85rem;
  margin-bottom: 16px;
  display: none;
}

.error-msg.show {
  display: block;
}

/* ===== APP SHELL ===== */
.app-shell {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.app-header {
  background: var(--priv-surface);
  border-bottom: 1px solid var(--priv-border);
  padding: 12px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 50;
  backdrop-filter: blur(12px);
}

.app-header-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.app-logo-sm {
  width: 36px;
  height: 36px;
  background: linear-gradient(135deg, #3b82f6, #22d3ee);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 0.75rem;
  color: white;
}

.app-title {
  font-size: 0.95rem;
  font-weight: 600;
}

.app-subtitle {
  font-size: 0.7rem;
  color: var(--priv-muted);
}

.app-header-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

.user-chip {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  background: var(--priv-card);
  border-radius: 100px;
  font-size: 0.8rem;
}

.user-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: linear-gradient(135deg, #3b82f6, #8b5cf6);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.7rem;
  font-weight: 700;
  color: white;
}

.btn-logout {
  padding: 8px 14px;
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.2);
  color: #f87171;
  border-radius: 10px;
  font-size: 0.8rem;
  font-weight: 500;
  cursor: pointer;
  min-height: 40px;
  transition: all 0.2s;
}

.btn-logout:hover {
  background: rgba(239, 68, 68, 0.2);
}

/* ===== ROOM SELECTOR ===== */
.room-selector {
  padding: 24px 16px;
  flex: 1;
}

.room-selector h2 {
  font-size: 1.3rem;
  margin-bottom: 8px;
}

.room-selector > p {
  color: var(--priv-muted);
  font-size: 0.9rem;
  margin-bottom: 24px;
}

.room-cards {
  display: grid;
  gap: 16px;
}

.room-card {
  background: var(--priv-card);
  border: 1px solid var(--priv-border);
  border-radius: var(--priv-radius);
  padding: 24px 20px;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  gap: 16px;
  min-height: 88px;
}

.room-card:hover,
.room-card:active {
  border-color: rgba(59, 130, 246, 0.5);
  background: var(--priv-elevated);
  transform: scale(0.99);
}

.room-icon {
  width: 56px;
  height: 56px;
  border-radius: 14px;
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.2), rgba(34, 211, 238, 0.1));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  flex-shrink: 0;
}

.room-info h3 {
  font-size: 1.1rem;
  margin-bottom: 4px;
}

.room-info p {
  font-size: 0.8rem;
  color: var(--priv-muted);
}

.room-arrow {
  margin-left: auto;
  color: var(--priv-muted);
  font-size: 1.2rem;
}

/* ===== CONTROL FORM ===== */
.control-view {
  padding: 16px;
  flex: 1;
  max-width: 480px;
  margin: 0 auto;
  width: 100%;
}

.control-header {
  margin-bottom: 20px;
}

.control-header h2 {
  font-size: 1.25rem;
  margin-bottom: 4px;
}

.meta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 20px;
}

.meta-chip {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  background: var(--priv-card);
  border: 1px solid var(--priv-border);
  border-radius: 10px;
  font-size: 0.8rem;
  color: var(--priv-muted);
}

.meta-chip strong {
  color: var(--priv-text);
}

.control-form-card {
  background: var(--priv-card);
  border: 1px solid var(--priv-border);
  border-radius: var(--priv-radius);
  padding: 24px 20px;
}

.control-form-card .form-group {
  margin-bottom: 20px;
}

.control-form-card label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--priv-muted);
  margin-bottom: 8px;
}

.control-form-card label .unit {
  font-size: 0.75rem;
  color: #64748b;
  background: rgba(255,255,255,0.05);
  padding: 2px 8px;
  border-radius: 6px;
}

.control-form-card input,
.control-form-card textarea {
  width: 100%;
  padding: 14px 16px;
  background: var(--priv-elevated);
  border: 1px solid var(--priv-border);
  border-radius: 12px;
  color: var(--priv-text);
  font-size: 1.05rem;
  min-height: 52px;
  transition: all 0.2s;
}

.control-form-card input:focus,
.control-form-card textarea:focus {
  border-color: var(--priv-accent);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2);
  outline: none;
}

.control-form-card input[type="number"] {
  font-size: 1.2rem;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.control-form-card textarea {
  min-height: 90px;
  resize: none;
  font-size: 0.95rem;
}

.btn-save {
  width: 100%;
  padding: 18px;
  background: linear-gradient(135deg, #10b981, #059669);
  color: white;
  font-weight: 700;
  font-size: 1.05rem;
  letter-spacing: 0.03em;
  border-radius: 14px;
  border: none;
  cursor: pointer;
  min-height: 56px;
  margin-top: 8px;
  box-shadow: 0 4px 20px rgba(16, 185, 129, 0.3);
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

.btn-save:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(16, 185, 129, 0.4);
}

.btn-save:active {
  transform: translateY(0);
}

.btn-back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 14px;
  color: var(--priv-muted);
  font-size: 0.9rem;
  margin-bottom: 16px;
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.2s;
  min-height: 44px;
}

.btn-back:hover {
  color: var(--priv-text);
  background: rgba(255,255,255,0.05);
}

/* Success Toast */
.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  background: #065f46;
  color: white;
  padding: 14px 24px;
  border-radius: 14px;
  font-weight: 500;
  font-size: 0.95rem;
  box-shadow: 0 10px 30px rgba(0,0,0,0.4);
  z-index: 200;
  opacity: 0;
  transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  align-items: center;
  gap: 10px;
  max-width: 90%;
}

.toast.show {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
}

/* Role Badge */
.role-badge {
  display: inline-flex;
  padding: 3px 8px;
  border-radius: 6px;
  font-size: 0.65rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.role-personel { background: rgba(59,130,246,0.15); color: #60a5fa; }
.role-tekniker { background: rgba(16,185,129,0.15); color: #34d399; }
.role-yonetici { background: rgba(245,158,11,0.15); color: #fbbf24; }
.role-admin { background: rgba(139,92,246,0.15); color: #a78bfa; }

/* Hidden views */
.view {
  display: none;
}

.view.active {
  display: block;
}

/* Mobile optimizations */
@media (max-width: 380px) {
  .login-card {
    padding: 32px 24px;
  }
  
  .control-form-card {
    padding: 20px 16px;
  }
  
  .meta-row {
    gap: 8px;
  }
  
  .meta-chip {
    padding: 6px 10px;
    font-size: 0.75rem;
  }
}

/* Prevent zoom on input focus (iOS) */
@media screen and (max-width: 480px) {
  input, select, textarea {
    font-size: 16px !important;
  }
}
