/* Sistema de Inventario - Enfermería UTT */
/* Estilos base y variables */

:root {
  --font-size: 16px;
  --background: #ffffff;
  --foreground: oklch(0.145 0 0);
  --primary: #2563eb;
  --primary-dark: #1e40af;
  --secondary: #e9ebef;
  --border: rgba(0, 0, 0, 0.1);
  --input-background: #f3f3f5;
  --muted: #ececf0;
  --muted-foreground: #717182;
  --destructive: #d4183d;
  --success: #059669;
  --warning: #f59e0b;
  --radius: 0.625rem;
  --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
  --shadow: 0 1px 3px 0 rgb(0 0 0 / 0.1);
  --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1);
  --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  font-size: var(--font-size);
  color: var(--foreground);
  background: var(--background);
  line-height: 1.5;
}

.container {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 1rem;
}

.container.login-container {
  max-width: none;
  width: 100%;
  padding: 2rem 1rem;
}

.hidden {
  display: none !important;
}

.main-layout {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.navbar {
  background: var(--primary);
  color: white;
  box-shadow: var(--shadow-md);
  position: sticky;
  top: 0;
  z-index: 100;
}

.navbar-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 4rem;
  padding: 0 2rem;
}

.navbar-brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.navbar-title h1,
.navbar-title {
  font-size: 1rem;
  font-weight: 600;
}

.navbar-subtitle {
  font-size: 0.75rem;
  opacity: 0.9;
}

.navbar-user {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.user-info {
  text-align: right;
}

.user-name {
  font-size: 0.875rem;
  font-weight: 500;
}

.user-role {
  font-size: 0.75rem;
  opacity: 0.9;
}

.content-wrapper {
  display: flex;
  flex: 1;
  max-width: 1280px;
  margin: 0 auto;
  width: 100%;
}

.sidebar {
  width: 16rem;
  background: white;
  box-shadow: var(--shadow-sm);
  min-height: calc(100vh - 4rem);
}

.sidebar-nav {
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  border-radius: var(--radius);
  text-decoration: none;
  color: #374151;
  transition: all 0.2s;
  font-size: 0.875rem;
}

.nav-link:hover {
  background: #f3f4f6;
}

.nav-link.active {
  background: #dbeafe;
  color: var(--primary);
  font-weight: 500;
}

.main-content {
  flex: 1;
  padding: 1.25rem;
  background: #f9fafb;
}

.page-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.page-title {
  font-size: 1.5rem;
  font-weight: 700;
}

.action-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.tab-button {
  border-radius: calc(var(--radius) / 2);
}

.tab-button.active {
  background: #dbeafe;
  color: #1d4ed8;
}

.card {
  background: white;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.card-header {
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--border);
}

.card-title {
  font-size: 1.05rem;
  font-weight: 600;
  margin-bottom: 0.15rem;
}

.card-description {
  font-size: 0.8rem;
  color: var(--muted-foreground);
}

.card-content {
  padding: 1rem 1.25rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  border-radius: var(--radius);
  font-size: 0.875rem;
  font-weight: 500;
  border: none;
  cursor: pointer;
  transition: all 0.2s;
  text-decoration: none;
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn-primary {
  background: var(--primary);
  color: white;
}

.btn-primary:hover:not(:disabled) {
  background: var(--primary-dark);
}

.btn-secondary {
  background: var(--secondary);
  color: var(--foreground);
}

.btn-secondary:hover:not(:disabled) {
  background: #d1d5db;
}

.btn-destructive {
  background: var(--destructive);
  color: white;
}

.btn-destructive:hover:not(:disabled) {
  background: #b91c3c;
}

.btn-outline {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--foreground);
}

.btn-outline:hover:not(:disabled) {
  background: var(--muted);
}

.btn-ghost {
  background: transparent;
  color: var(--foreground);
}

.btn-ghost:hover:not(:disabled) {
  background: var(--muted);
}

.btn-sm {
  padding: 0.375rem 0.75rem;
  font-size: 0.8125rem;
}

.btn-lg {
  padding: 0.75rem 1.5rem;
  font-size: 1rem;
}

.form-group {
  margin-bottom: 1rem;
}

.form-label {
  display: block;
  font-size: 0.875rem;
  font-weight: 500;
  margin-bottom: 0.5rem;
}

.form-input,
.form-select,
.form-textarea {
  width: 100%;
  padding: 0.5rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--input-background);
  font-size: 0.875rem;
  transition: all 0.2s;
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.form-textarea {
  resize: vertical;
  min-height: 80px;
}

.badge {
  display: inline-flex;
  align-items: center;
  padding: 0.25rem 0.625rem;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 500;
}

.badge-default {
  background: var(--primary);
  color: white;
}

.badge-secondary {
  background: var(--secondary);
  color: var(--foreground);
}

.badge-success {
  background: #d1fae5;
  color: #065f46;
}

.badge-warning {
  background: #fed7aa;
  color: #92400e;
}

.badge-destructive {
  background: #fee2e2;
  color: #991b1b;
}

.badge-outline {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--foreground);
}

.grid {
  display: grid;
  gap: 0.75rem;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}

.inventory-grid .card {
  padding: 0;
  min-width: 240px;
}

.inventory-grid .card-content {
  padding: 0.75rem 1rem;
}

.inventory-grid .card {
  border-radius: calc(var(--radius) * 0.9);
}

.grid-cols-1 { grid-template-columns: repeat(1, minmax(0, 1fr)); }
.grid-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }

@media (min-width: 768px) {
  .md\\:grid-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .md\\:grid-cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .md\\:grid-cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

@media (min-width: 1024px) {
  .lg\\:grid-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .lg\\:grid-cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .lg\\:grid-cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

.stat-card {
  background: white;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1rem 1.1rem;
}

.stat-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.35rem;
}

.stat-title {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--muted-foreground);
}

.stat-value {
  font-size: 1.25rem;
  font-weight: 700;
  margin-bottom: 0.15rem;
}

.stat-description {
  font-size: 0.75rem;
  color: var(--muted-foreground);
}

.table-container {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
}

thead {
  background: var(--muted);
}

th {
  text-align: left;
  padding: 0.75rem 1rem;
  font-weight: 600;
  color: var(--foreground);
}

td {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--border);
}

tbody tr:hover {
  background: var(--muted);
}

.alert {
  padding: 1rem;
  border-radius: var(--radius);
  margin-bottom: 1rem;
  display: flex;
  align-items: start;
  gap: 0.75rem;
}

.alert-info {
  background: #dbeafe;
  color: #1e40af;
}

.alert-success {
  background: #d1fae5;
  color: #065f46;
}

.alert-warning {
  background: #fed7aa;
  color: #92400e;
}

.alert-error {
  background: #fee2e2;
  color: #991b1b;
}

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.modal {
  background: white;
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  max-width: 32rem;
  width: 90%;
  max-height: 90vh;
  overflow-y: auto;
}

.modal-header {
  padding: 1.5rem;
  border-bottom: 1px solid var(--border);
}

.modal-title {
  font-size: 1.25rem;
  font-weight: 600;
}

.modal-content {
  padding: 1.5rem;
}

.modal-footer {
  padding: 1.5rem;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: flex-end;
  gap: 0.75rem;
}

.mt-1 { margin-top: 0.25rem; }
.mt-2 { margin-top: 0.5rem; }
.mt-3 { margin-top: 0.75rem; }
.mt-4 { margin-top: 1rem; }
.mt-6 { margin-top: 1.5rem; }
.mb-2 { margin-bottom: 0.5rem; }
.mb-4 { margin-bottom: 1rem; }
.mb-6 { margin-bottom: 1.5rem; }

.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.justify-end { justify-content: flex-end; }
.gap-2 { gap: 0.5rem; }
.gap-3 { gap: 0.75rem; }
.gap-4 { gap: 1rem; }

.text-center { text-align: center; }
.text-sm { font-size: 0.875rem; }
.text-xs { font-size: 0.75rem; }
.font-medium { font-weight: 500; }
.font-semibold { font-weight: 600; }
.font-bold { font-weight: 700; }

.text-gray-500 { color: #6b7280; }
.text-gray-600 { color: #4b5563; }
.text-blue-600 { color: var(--primary); }
.text-red-600 { color: var(--destructive); }
.text-green-600 { color: var(--success); }
.text-orange-600 { color: var(--warning); }

.login-container {
  min-height: 100vh;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #dbeafe 0%, #bfdbfe 100%);
}

.login-card {
  width: 100%;
  max-width: 28rem;
  margin: 1rem;
}

.login-header {
  text-align: center;
  margin-bottom: 1.5rem;
}

.login-icon {
  width: 4rem;
  height: 4rem;
  background: var(--primary);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 1rem;
}

.login-icon span {
  color: white;
  font-size: 1.5rem;
}

.w-full { width: 100%; }

/*=========================================
ALERTAS
=========================================*/

.alert{

    padding:15px 20px;

    border-radius:10px;

    margin-bottom:20px;

    font-weight:600;

    animation:fadeIn .3s ease;

}

.alert-success{

    background:#dcfce7;

    color:#166534;

    border-left:5px solid #22c55e;

}

.alert-error{

    background:#fee2e2;

    color:#991b1b;

    border-left:5px solid #ef4444;

}

.alert-warning{

    background:#fef3c7;

    color:#92400e;

    border-left:5px solid #f59e0b;

}

.alert-info{

    background:#dbeafe;

    color:#1d4ed8;

    border-left:5px solid #3b82f6;

}

@keyframes fadeIn{

    from{

        opacity:0;

        transform:translateY(-10px);

    }

    to{

        opacity:1;

        transform:translateY(0);

    }

}

/* ===== Badges ===== */

.badge{

    display:inline-block;
    padding:4px 10px;
    border-radius:20px;
    font-size:12px;
    font-weight:bold;
    color:#fff;
    text-align:center;

}

.badge-success{

    background:#16a34a;

}

.badge-warning{

    background:#f59e0b;

}

.badge-danger{

    background:#dc2626;

}

.badge-info{

    background:#2563eb;

}

/* ===== Estadísticas ===== */

.estadisticas-materiales{

    display:grid;
    grid-template-columns:repeat(auto-fit,minmax(200px,1fr));
    gap:20px;
    margin-bottom:25px;

}

.estadistica-card{

    text-align:center;
    padding:20px;

}

.estadistica-numero{

    font-size:38px;
    font-weight:bold;
    color:#2563eb;

}

.estadistica-texto{

    margin-top:10px;
    color:#666;
    font-size:15px;

}
