:root {
  --maia-navy: #1e293b;
  --maia-navy-soft: #334155;
  --maia-gold: #8a7b60;
  --maia-gold-light: #d5c7a1;
  --page-bg: #f5f7fa;
}

body { background: var(--page-bg); color: #172033; min-height: 100vh; }
a { color: #526786; }
.app-container { max-width: 1560px; }
.page-title { font-size: clamp(1.5rem, 2.2vw, 2rem); font-weight: 650; }

.navbar-maia { background: var(--maia-navy); min-height: 74px; }
.navbar-maia .navbar-brand { display: flex; align-items: center; gap: .8rem; color: #fff; }
.navbar-maia .navbar-brand img { width: 58px; height: 48px; object-fit: contain; }
.brand-title { font-size: 1.08rem; font-weight: 600; }
.brand-title small { color: var(--maia-gold-light); margin-left: .25rem; }
.navbar-maia .nav-link, .navbar-user-info { color: #f8fafc !important; }
.navbar-maia .nav-link:hover, .navbar-maia .nav-link:focus { color: var(--maia-gold-light) !important; }
.navbar-maia .dropdown-menu { background: var(--maia-navy); border-color: var(--maia-navy-soft); }
.navbar-maia .dropdown-item { color: #f8fafc; }
.navbar-maia .dropdown-item:hover { background: #2f3a4e; color: #fff; }
.navbar-user-info { display: flex; flex-direction: column; align-items: flex-end; line-height: 1.1; }
.navbar-user-info small { color: var(--maia-gold-light); font-size: .72rem; margin-top: .25rem; }
.nav-logout-icon { color: var(--maia-gold-light); font-size: 1.4rem; }
.nav-logout-icon:hover { color: #fff; }

.card { border: 1px solid #dfe4ea; box-shadow: 0 .125rem .35rem rgba(15, 23, 42, .055); }
.card-header { background: #fff; padding: .9rem 1.1rem; }
.btn-primary { background: var(--maia-gold); border-color: var(--maia-gold); }
.btn-primary:hover, .btn-primary:focus { background: #746850; border-color: #746850; }
.btn-outline-primary { color: var(--maia-gold); border-color: var(--maia-gold); }
.btn-outline-primary:hover { background: var(--maia-gold); border-color: var(--maia-gold); }
.form-control:focus, .form-select:focus { border-color: #ac9a75; box-shadow: 0 0 0 .2rem rgba(138,123,96,.18); }
.form-hint { color: #64748b; font-size: .85rem; }
.form-page { max-width: 760px; margin: 0 auto; }

.metric-card .card-body { min-height: 112px; }
.metric-icon { display: grid; place-items: center; width: 52px; height: 52px; border-radius: 12px; background: #eef2f7; font-size: 1.55rem; }
.metric-value { font-size: 1.8rem; font-weight: 700; line-height: 1; }
.admin-card { text-decoration: none; color: inherit; transition: transform .15s, box-shadow .15s; }
.admin-card:hover { transform: translateY(-2px); box-shadow: 0 .5rem 1rem rgba(15,23,42,.10); }
.admin-card i { color: var(--maia-gold); font-size: 1.8rem; }

.table { --bs-table-bg: transparent; }
.table th { color: #344054; font-size: .82rem; font-weight: 650; white-space: nowrap; }
.table td { vertical-align: middle; }
.inventory-table td { white-space: nowrap; }
.status-badge { display: inline-block; border-radius: 999px; padding: .28rem .55rem; font-size: .7rem; font-weight: 700; white-space: nowrap; }
.status-ativo { background: #d1fae5; color: #065f46; }
.status-estoque { background: #dbeafe; color: #1e40af; }
.status-emprestado { background: #fef3c7; color: #92400e; }
.status-manutencao { background: #fee2e2; color: #991b1b; }
.status-baixado, .status-arquivado { background: #e5e7eb; color: #374151; }

.detail-grid { display: grid; grid-template-columns: minmax(130px, 42%) 1fr; gap: .75rem 1rem; margin: 0; }
.detail-grid dt { color: #64748b; font-weight: 500; }
.detail-grid dd { margin: 0; font-weight: 550; }
.stock-quantity { display: grid; place-items: center; min-width: 48px; height: 48px; border-radius: 12px; background: #dcfce7; color: #166534; font-size: 1.25rem; font-weight: 700; }
.stock-quantity.low { background: #fee2e2; color: #991b1b; }
.empty-state { text-align: center; color: #64748b; background: #fff; border: 1px dashed #cbd5e1; border-radius: .6rem; padding: 4rem 1rem; }

.login-page { min-height: calc(100vh - 3rem); display: grid; place-items: center; }
.login-card { width: min(430px, 100%); }
.login-logo { max-width: 230px; max-height: 112px; object-fit: contain; }
body:has(.login-page) { background: #9c9265; }
.app-version { position: fixed; right: .75rem; bottom: .5rem; z-index: 1020; background: rgba(255,255,255,.9); color: #6b7280; border-radius: .25rem; padding: .15rem .45rem; font-size: .72rem; }

@media (max-width: 991.98px) {
  .navbar-user-info { align-items: flex-start; margin-top: .75rem; }
  .nav-logout-icon { display: inline-block; margin: .7rem 0 .2rem !important; }
  .inventory-table td { white-space: normal; min-width: 120px; }
}
