/* ========================================
   Indrammerske — Admin Panel Styles
   ======================================== */

.logo {
  text-decoration: none;
  color: var(--fg);
}

.admin-badge {
  font-size: 0.8125rem;
  color: var(--muted-fg);
  background: var(--muted);
  padding: 4px 12px;
  border-radius: 20px;
}

.admin-main {
  max-width: 800px;
  margin: 0 auto;
  padding: 32px 48px 96px;
}

/* ---- Tabs ---- */

.tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 32px;
  border-bottom: 1px solid var(--border);
  padding-bottom: 0;
}

.tab {
  padding: 10px 20px;
  border: none;
  background: none;
  font-family: inherit;
  font-size: 0.875rem;
  font-weight: 400;
  color: var(--muted-fg);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: all var(--transition);
  margin-bottom: -1px;
}

.tab:hover {
  color: var(--fg);
}

.tab.active {
  color: var(--fg);
  font-weight: 500;
  border-bottom-color: var(--fg);
}

.tab-content {
  display: none;
}

.tab-content.active {
  display: block;
  animation: fadeInUp 0.3s ease both;
}

/* ---- Section Header ---- */

.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}

.section-header h2 {
  font-size: 1.125rem;
  font-weight: 500;
  letter-spacing: -0.01em;
}

/* ---- Buttons ---- */

.btn {
  border: none;
  font-family: inherit;
  cursor: pointer;
  border-radius: var(--radius-sm);
  transition: all var(--transition);
  font-size: 0.8125rem;
  font-weight: 500;
}

.btn--primary {
  background: var(--fg);
  color: var(--bg);
  padding: 8px 16px;
}

.btn--primary:hover {
  opacity: 0.85;
}

.btn--small {
  background: var(--muted);
  color: var(--fg);
  padding: 6px 12px;
  font-size: 0.75rem;
}

.btn--small:hover {
  background: var(--border);
}

.btn--danger {
  background: none;
  color: var(--muted-fg);
  padding: 4px 8px;
  font-size: 0.75rem;
}

.btn--danger:hover {
  color: #D32F2F;
}

/* ---- Data Table ---- */

.table-wrapper {
  overflow-x: auto;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
}

.data-table th {
  text-align: left;
  padding: 8px 12px;
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--muted-fg);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-bottom: 1px solid var(--border);
}

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

.data-table tr:last-child td {
  border-bottom: none;
}

.data-table input[type="text"],
.data-table input[type="number"] {
  border: 1px solid transparent;
  background: transparent;
  padding: 6px 8px;
  border-radius: 4px;
  font-family: inherit;
  font-size: 0.875rem;
  color: var(--fg);
  width: 100%;
  transition: all var(--transition);
}

.data-table input:hover {
  border-color: var(--border);
}

.data-table input:focus {
  border-color: var(--accent);
  background: white;
  outline: none;
}

.data-table input[type="number"] {
  width: 80px;
  font-variant-numeric: tabular-nums;
}

.data-table input[type="color"] {
  width: 32px;
  height: 32px;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 2px;
  cursor: pointer;
  background: none;
}

.data-table select {
  border: 1px solid transparent;
  background: transparent;
  padding: 6px 8px;
  border-radius: 4px;
  font-family: inherit;
  font-size: 0.875rem;
  color: var(--fg);
  cursor: pointer;
  transition: all var(--transition);
}

.data-table select:hover {
  border-color: var(--border);
}

.data-table select:focus {
  border-color: var(--accent);
  outline: none;
}

/* ---- Form Card ---- */

.form-card {
  background: var(--muted);
  border-radius: var(--radius);
  padding: 28px 32px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.form-row {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.form-row label {
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--muted-fg);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.form-input {
  border: 1px solid var(--border);
  background: white;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 1rem;
  color: var(--fg);
  width: 200px;
  transition: border-color var(--transition);
  font-variant-numeric: tabular-nums;
}

.form-input:focus {
  border-color: var(--accent);
  outline: none;
}

.form-color {
  width: 48px;
  height: 48px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 4px;
  cursor: pointer;
  background: none;
}

/* ---- Color List ---- */

.color-list {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 8px;
}

.color-item {
  display: flex;
  align-items: center;
  gap: 6px;
  background: white;
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 4px 10px 4px 4px;
}

.color-item input[type="color"] {
  width: 24px;
  height: 24px;
  border: none;
  border-radius: 50%;
  padding: 0;
  cursor: pointer;
  background: none;
}

.color-item-remove {
  background: none;
  border: none;
  color: var(--muted-fg);
  cursor: pointer;
  font-size: 0.75rem;
  padding: 2px 4px;
  border-radius: 4px;
  transition: color var(--transition);
}

.color-item-remove:hover {
  color: #D32F2F;
}

.color-name-input {
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 3px 8px;
  font-size: 0.8rem;
  font-family: inherit;
  width: 90px;
  color: var(--fg);
}

/* ---- Save Status ---- */

/* ---- Profile Cards (Frame Editor) ---- */

.profile-cards {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.profile-card {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: border-color var(--transition);
}

.profile-card:hover {
  border-color: var(--border-hover);
}

.profile-preview-wrap {
  margin-bottom: 12px;
}

.profile-preview-bar {
  width: 100%;
  min-height: 8px;
  background-repeat: repeat;
  border-radius: 4px;
}

.profile-body {
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  position: relative;
}

.profile-info {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.profile-name {
  border: 1px solid transparent;
  background: transparent;
  padding: 6px 8px;
  border-radius: 4px;
  font-family: inherit;
  font-size: 0.9375rem;
  font-weight: 500;
  color: var(--fg);
  width: 160px;
  transition: all var(--transition);
}

.profile-name:hover {
  border-color: var(--border);
}

.profile-name:focus {
  border-color: var(--accent);
  background: white;
  outline: none;
}

.profile-info select {
  border: 1px solid transparent;
  background: transparent;
  padding: 6px 8px;
  border-radius: 4px;
  font-family: inherit;
  font-size: 0.8125rem;
  color: var(--muted-fg);
  cursor: pointer;
  transition: all var(--transition);
}

.profile-info select:hover {
  border-color: var(--border);
}

.profile-info select:focus {
  border-color: var(--accent);
  outline: none;
}

.profile-meta {
  display: flex;
  gap: 12px;
  margin-left: auto;
}

.profile-meta-field {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 0.75rem;
  color: var(--muted-fg);
  font-weight: 400;
}

.profile-meta-field input {
  border: 1px solid transparent;
  background: transparent;
  padding: 4px 6px;
  border-radius: 4px;
  font-family: inherit;
  font-size: 0.8125rem;
  font-variant-numeric: tabular-nums;
  color: var(--fg);
  width: 56px;
  text-align: right;
  transition: all var(--transition);
}

.profile-meta-field input:hover {
  border-color: var(--border);
}

.profile-meta-field input:focus {
  border-color: var(--accent);
  background: white;
  outline: none;
}

.profile-controls {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.profile-color-tex {
  display: flex;
  align-items: center;
  gap: 8px;
}

.profile-color-tex input[type="color"] {
  width: 28px;
  height: 28px;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 2px;
  cursor: pointer;
  background: none;
}

.texture-btn {
  cursor: pointer;
  white-space: nowrap;
}

.profile-delete {
  position: absolute;
  top: 12px;
  right: 12px;
}

.tex-rotate-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.tex-rotate-btn svg {
  flex-shrink: 0;
}

.tex-rotate-btn.rotated {
  border-color: var(--accent);
  color: var(--fg);
  background: var(--muted);
}

.texture-sliders {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.texture-slider-row {
  display: flex;
  align-items: center;
  gap: 6px;
}

.texture-slider-label {
  font-size: 0.6875rem;
  color: var(--muted-fg);
  font-weight: 500;
  min-width: 48px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.texture-slider-row input[type="range"] {
  flex: 1;
  -webkit-appearance: none;
  appearance: none;
  height: 2px;
  background: var(--border);
  border-radius: 1px;
  outline: none;
  min-width: 60px;
}

.texture-slider-row input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--fg);
  cursor: pointer;
}

.texture-slider-row input[type="range"]::-moz-range-thumb {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--fg);
  border: none;
  cursor: pointer;
}

.texture-slider-value {
  font-size: 0.6875rem;
  color: var(--muted-fg);
  font-variant-numeric: tabular-nums;
  min-width: 28px;
  text-align: right;
}

/* ---- Config Bar ---- */

.config-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 40px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
}

.config-bar-left {
  display: flex;
  gap: 8px;
}

.btn--outline {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: transparent;
  border: 1px solid var(--border);
  color: var(--fg);
  padding: 8px 16px;
  cursor: pointer;
}

.btn--outline:hover {
  border-color: var(--border-hover);
  background: var(--muted);
}

.btn--ghost {
  background: none;
  border: none;
  color: var(--muted-fg);
  padding: 8px 16px;
  font-size: 0.8125rem;
  cursor: pointer;
  transition: color var(--transition);
}

.btn--ghost:hover {
  color: #D32F2F;
}

/* ---- Save Status ---- */

.save-status {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: var(--fg);
  color: var(--bg);
  padding: 10px 20px;
  border-radius: 24px;
  font-size: 0.8125rem;
  font-weight: 500;
  opacity: 0;
  transform: translateY(8px);
  transition: all 0.3s ease;
  pointer-events: none;
}

.save-status.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ---- Responsive ---- */

@media (max-width: 640px) {
  .admin-main {
    padding: 24px;
  }

  .form-input {
    width: 100%;
  }

  .data-table input[type="number"] {
    width: 60px;
  }
}
