/**
 * Asset Register - Custom styles (Tailwind used via CDN)
 */
:root {
  --color-primary: #0f172a;
  --color-accent: #f59e0b;
}

@media print {
  header, footer, .no-print, nav, .btn-print-hide, button {
    display: none !important;
  }
  body { padding: 0; }
}

/* App layout: sidebar full height left, header to the right of sidebar, main scrolls */
.app-body {
  overflow: hidden;
  min-height: 100vh;
}
.app-header {
  left: 14rem;
}
.app-main {
  margin-left: 14rem;
  margin-top: 3.5rem;
  height: calc(100vh - 3.5rem);
  overflow-y: auto;
  padding: 1.5rem 1rem;
  transition: margin-left 0.2s ease;
}
@media (min-width: 640px) {
  .app-main { padding: 2rem 1.5rem; }
}
@media (min-width: 1024px) {
  .app-main { padding: 2rem 2rem; max-width: 80rem; }
}

/* Collapsed sidebar */
.sidebar-collapsed #sidebar {
  width: 4rem;
}
.sidebar-collapsed .app-header {
  left: 4rem;
}
.sidebar-collapsed .app-main {
  margin-left: 4rem;
}
.sidebar-collapsed .sidebar-label {
  display: none;
}
.sidebar-collapsed .sidebar-link {
  justify-content: center;
  padding-left: 0.75rem;
  padding-right: 0.75rem;
}
.sidebar-collapsed #sidebar-toggle .sidebar-label {
  display: none;
}
.sidebar-collapsed #sidebar-toggle {
  justify-content: center;
  padding-left: 0.75rem;
  padding-right: 0.75rem;
}
.sidebar-collapsed #sidebar-toggle-icon-open {
  display: none;
}
.sidebar-collapsed #sidebar-toggle-icon-closed {
  display: block !important;
}

.page-container {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.btn-primary {
  padding: 0.5rem 1rem;
  background-color: #f59e0b;
  color: white;
  border-radius: 0.5rem;
  font-weight: 500;
}
.btn-primary:hover {
  background-color: #d97706;
}

.btn-secondary {
  padding: 0.5rem 1rem;
  background-color: #e2e8f0;
  color: #334155;
  border-radius: 0.5rem;
  font-weight: 500;
}
.btn-secondary:hover {
  background-color: #cbd5e1;
}

.btn-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  padding: 0;
  border: none;
  border-radius: 0.375rem;
  color: #475569;
  background: transparent;
  cursor: pointer;
  transition: color 0.15s, background-color 0.15s;
}
.btn-icon:hover {
  color: #0f172a;
  background-color: #e2e8f0;
}
.btn-icon.btn-icon-primary:hover {
  color: #fff;
  background-color: #f59e0b;
}

.form-input {
  display: block;
  width: 100%;
  border-radius: 0.5rem;
  border: 1px solid #cbd5e1;
  padding: 0.5rem 0.75rem;
  box-shadow: 0 1px 2px 0 rgb(0 0 0 / 0.05);
}
.form-input:focus {
  border-color: #f59e0b;
  outline: none;
  box-shadow: 0 0 0 1px #f59e0b;
}

.form-label {
  display: block;
  font-size: 0.875rem;
  font-weight: 500;
  color: #334155;
  margin-bottom: 0.25rem;
}

/* Dialog (modal) */
.dialog {
  padding: 0;
  border: 1px solid #e2e8f0;
  border-radius: 0.5rem;
  box-shadow: 0 25px 50px -12px rgb(0 0 0 / 0.25);
  max-width: 28rem;
  width: 90%;
}
.dialog.dialog-lg {
  max-width: 40rem;
}
.dialog::backdrop {
  background: rgba(15, 23, 42, 0.5);
}
.dialog-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 1.5rem;
  border-bottom: 1px solid #e2e8f0;
  background: #f8fafc;
  border-radius: 0.5rem 0.5rem 0 0;
}
.dialog-title {
  font-size: 1.125rem;
  font-weight: 600;
  color: #1e293b;
}
.dialog-close {
  background: none;
  border: none;
  padding: 0.25rem;
  color: #64748b;
  cursor: pointer;
  border-radius: 0.25rem;
  line-height: 1;
}
.dialog-close:hover {
  color: #1e293b;
  background: #e2e8f0;
}
.dialog-body {
  padding: 1.5rem;
}

/* Status badges */
.badge {
  display: inline-block;
  padding: 0.25rem 0.5rem;
  font-size: 0.75rem;
  font-weight: 600;
  border-radius: 9999px;
  text-transform: capitalize;
}
.badge-active {
  background-color: #dcfce7;
  color: #166534;
}
.badge-reserve {
  background-color: #e0e7ff;
  color: #3730a3;
}
.badge-maintenance {
  background-color: #fef3c7;
  color: #92400e;
}
.badge-deprecated {
  background-color: #fee2e2;
  color: #991b1b;
}
