/* ============================================================
   MMSL Admin Panel — Styles
   ============================================================ */

:root {
  --color-primary: #0A4A8C;
  --color-primary-light: #1565C0;
  --color-primary-dark: #062F5A;
  --color-secondary: #00897B;
  --color-secondary-light: #26A69A;
  --color-white: #FFFFFF;
  --color-off-white: #F4F7FA;
  --color-light-gray: #E8EDF3;
  --color-mid-gray: #6B7A8D;
  --color-dark: #1A2533;
  --color-success: #2E7D32;
  --color-danger: #C62828;
  --color-warning: #E65100;

  --font-heading: 'Poppins', sans-serif;
  --font-body: 'Inter', sans-serif;

  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.08);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.1);
  --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.12);

  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-full: 9999px;

  --sidebar-width: 260px;
}

/* Reset */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: var(--font-body);
  font-size: 0.95rem;
  line-height: 1.6;
  color: var(--color-dark);
  background: var(--color-off-white);
  -webkit-font-smoothing: antialiased;
}

a { color: var(--color-primary); text-decoration: none; }
ul { list-style: none; }

h1, h2, h3, h4 {
  font-family: var(--font-heading);
  font-weight: 600;
}

/* ============================================================
   LOGIN PAGE
   ============================================================ */
.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--color-primary-dark) 0%, var(--color-primary) 50%, var(--color-secondary) 100%);
  padding: 1rem;
}

.login-card {
  background: var(--color-white);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  padding: 2.5rem;
  width: 100%;
  max-width: 420px;
}

.login-card__logo {
  text-align: center;
  margin-bottom: 2rem;
}

.login-card__logo h1 {
  font-size: 1.5rem;
  color: var(--color-primary-dark);
}

.login-card__logo h1 span {
  color: var(--color-secondary);
}

.login-card__logo p {
  color: var(--color-mid-gray);
  font-size: 0.85rem;
  margin-top: 0.25rem;
}

.form-group {
  margin-bottom: 1.25rem;
}

.form-group label {
  display: block;
  font-weight: 500;
  margin-bottom: 0.4rem;
  font-size: 0.85rem;
  color: var(--color-dark);
}

.form-group .help-text {
  font-size: 0.75rem;
  color: var(--color-mid-gray);
  margin-top: 0.25rem;
}

.form-control {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid var(--color-light-gray);
  border-radius: var(--radius-md);
  font-size: 0.9rem;
  color: var(--color-dark);
  background: var(--color-white);
  transition: border-color 0.2s, box-shadow 0.2s;
}

.form-control:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(10, 74, 140, 0.1);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 10px 24px;
  font-weight: 600;
  font-size: 0.9rem;
  border-radius: var(--radius-md);
  border: 2px solid transparent;
  cursor: pointer;
  transition: all 0.2s;
}

.btn--primary {
  background: var(--color-primary);
  color: var(--color-white);
  border-color: var(--color-primary);
}

.btn--primary:hover {
  background: var(--color-primary-light);
  border-color: var(--color-primary-light);
}

.btn--secondary {
  background: var(--color-secondary);
  color: var(--color-white);
  border-color: var(--color-secondary);
}

.btn--secondary:hover {
  background: var(--color-secondary-light);
  border-color: var(--color-secondary-light);
}

.btn--danger {
  background: var(--color-danger);
  color: var(--color-white);
  border-color: var(--color-danger);
}

.btn--danger:hover {
  background: #B71C1C;
  border-color: #B71C1C;
}

.btn--outline {
  background: transparent;
  color: var(--color-primary);
  border-color: var(--color-light-gray);
}

.btn--outline:hover {
  border-color: var(--color-primary);
  background: rgba(10, 74, 140, 0.05);
}

.btn--sm {
  padding: 6px 14px;
  font-size: 0.8rem;
}

.btn--full {
  width: 100%;
}

.login-error {
  display: none;
  background: #FFEBEE;
  color: var(--color-danger);
  padding: 0.75rem 1rem;
  border-radius: var(--radius-md);
  font-size: 0.85rem;
  margin-bottom: 1rem;
}

.login-error.show { display: block; }

/* ============================================================
   DASHBOARD LAYOUT
   ============================================================ */
.dashboard {
  display: flex;
  min-height: 100vh;
}

/* Sidebar */
.sidebar {
  width: var(--sidebar-width);
  background: var(--color-primary-dark);
  color: var(--color-white);
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  overflow-y: auto;
  z-index: 100;
}

.sidebar__logo {
  padding: 1.5rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.sidebar__logo h2 {
  font-size: 1.1rem;
  color: var(--color-white);
}

.sidebar__logo h2 span {
  color: var(--color-secondary-light);
}

.sidebar__logo p {
  font-size: 0.75rem;
  color: rgba(255, 255, 255, 0.5);
  margin-top: 0.25rem;
}

.sidebar__nav {
  padding: 1rem 0;
}

.sidebar__label {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: rgba(255, 255, 255, 0.4);
  padding: 0.5rem 1.5rem;
  margin-top: 0.5rem;
}

.sidebar__link {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1.5rem;
  color: rgba(255, 255, 255, 0.7);
  font-size: 0.9rem;
  transition: all 0.2s;
  cursor: pointer;
}

.sidebar__link:hover {
  background: rgba(255, 255, 255, 0.08);
  color: var(--color-white);
}

.sidebar__link.active {
  background: rgba(255, 255, 255, 0.12);
  color: var(--color-white);
  border-left: 3px solid var(--color-secondary-light);
}

.sidebar__link i {
  width: 20px;
  text-align: center;
}

.sidebar__link--danger {
  color: #EF9A9A;
  margin-top: 1rem;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  padding-top: 1.25rem;
}

.sidebar__link--danger:hover {
  color: #EF5350;
  background: rgba(239, 83, 80, 0.1);
}

/* Main content */
.main-content {
  margin-left: var(--sidebar-width);
  flex: 1;
  padding: 2rem;
  min-height: 100vh;
}

.main-content__header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2rem;
  flex-wrap: wrap;
  gap: 1rem;
}

.main-content__header h1 {
  font-size: 1.5rem;
}

/* Panel/Card */
.panel {
  background: var(--color-white);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  margin-bottom: 1.5rem;
}

.panel__header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--color-light-gray);
}

.panel__header h3 {
  font-size: 1rem;
}

.panel__body {
  padding: 1.5rem;
}

/* Table */
.table-wrap {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
}

th, td {
  text-align: left;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--color-light-gray);
  font-size: 0.85rem;
}

th {
  font-weight: 600;
  color: var(--color-mid-gray);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  background: var(--color-off-white);
}

td { color: var(--color-dark); }

tr:last-child td { border-bottom: none; }

tr:hover td { background: rgba(244, 247, 250, 0.5); }

/* Badge */
.badge {
  display: inline-block;
  padding: 2px 10px;
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-weight: 600;
}

.badge--active {
  background: rgba(46, 125, 50, 0.1);
  color: var(--color-success);
}

.badge--inactive {
  background: rgba(107, 122, 141, 0.1);
  color: var(--color-mid-gray);
}

.badge--featured {
  background: rgba(10, 74, 140, 0.1);
  color: var(--color-primary);
}

/* Actions */
.actions {
  display: flex;
  gap: 0.5rem;
}

.btn-icon {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-md);
  border: 1px solid var(--color-light-gray);
  background: var(--color-white);
  color: var(--color-mid-gray);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s;
  font-size: 0.8rem;
}

.btn-icon:hover {
  border-color: var(--color-primary);
  color: var(--color-primary);
  background: rgba(10, 74, 140, 0.05);
}

.btn-icon--danger:hover {
  border-color: var(--color-danger);
  color: var(--color-danger);
  background: rgba(198, 40, 40, 0.05);
}

/* Modal */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 200;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.modal-overlay.show {
  display: flex;
}

.modal {
  background: var(--color-white);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  width: 100%;
  max-width: 600px;
  max-height: 90vh;
  overflow-y: auto;
}

.modal__header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--color-light-gray);
}

.modal__header h3 {
  font-size: 1.1rem;
}

.modal__close {
  background: none;
  border: none;
  font-size: 1.2rem;
  color: var(--color-mid-gray);
  cursor: pointer;
  padding: 0.25rem;
}

.modal__close:hover { color: var(--color-dark); }

.modal__body {
  padding: 1.5rem;
}

.modal__footer {
  padding: 1rem 1.5rem;
  border-top: 1px solid var(--color-light-gray);
  display: flex;
  justify-content: flex-end;
  gap: 0.75rem;
}

textarea.form-control {
  min-height: 80px;
  resize: vertical;
}

/* Toast notification */
.toast-container {
  position: fixed;
  top: 1rem;
  right: 1rem;
  z-index: 300;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.toast {
  background: var(--color-white);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  padding: 1rem 1.5rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.85rem;
  min-width: 280px;
  animation: slideIn 0.3s ease;
  border-left: 4px solid var(--color-success);
}

.toast--error {
  border-left-color: var(--color-danger);
}

.toast i {
  font-size: 1.1rem;
}

.toast--success i { color: var(--color-success); }
.toast--error i { color: var(--color-danger); }

@keyframes slideIn {
  from { transform: translateX(100%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

/* Section views — hide/show */
.section-view {
  display: none;
}

.section-view.active {
  display: block;
}

/* Stat cards on dashboard */
.stat-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
  margin-bottom: 2rem;
}

.stat-card {
  background: var(--color-white);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  padding: 1.5rem;
  display: flex;
  align-items: center;
  gap: 1rem;
}

.stat-card__icon {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
}

.stat-card__icon--primary {
  background: rgba(10, 74, 140, 0.1);
  color: var(--color-primary);
}

.stat-card__icon--secondary {
  background: rgba(0, 137, 123, 0.1);
  color: var(--color-secondary);
}

.stat-card__icon--success {
  background: rgba(46, 125, 50, 0.1);
  color: var(--color-success);
}

.stat-card__text h3 {
  font-size: 1.5rem;
  line-height: 1;
}

.stat-card__text p {
  font-size: 0.8rem;
  color: var(--color-mid-gray);
  margin-top: 0.25rem;
}

/* Items list for requirements/responsibilities */
.items-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}

.items-list__item {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}

.items-list__item input {
  flex: 1;
}

.items-list__item button {
  flex-shrink: 0;
}

/* Responsive */
@media (max-width: 768px) {
  .sidebar {
    display: none;
  }

  .main-content {
    margin-left: 0;
    padding: 1rem;
  }
}
