/* area-restrita/style.css */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
:root {
  --primary: #1565c0;
  --primary-dark: #0d47a1;
  --accent: #ff6f00;
  --green: #2e7d32;
  --red: #c62828;
  --text: #1a1a2e;
  --text-light: #666;
  --bg: #f0f4f8;
  --white: #fff;
  --border: #d0d7e2;
  --shadow: 0 2px 16px rgba(0,0,0,0.08);
  --radius: 12px;
  --sidebar-w: 260px;
}
body { font-family: 'Segoe UI', Arial, sans-serif; background: var(--bg); color: var(--text); }

/* ===== LOGIN ===== */
.login-page {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, #0d47a1 0%, #1565c0 50%, #1e88e5 100%);
}
.login-card {
  background: var(--white); border-radius: 20px; padding: 48px 40px;
  width: 100%; max-width: 420px; box-shadow: 0 20px 60px rgba(0,0,0,0.2);
}
.login-logo { text-align: center; margin-bottom: 8px; font-size: 1.6rem; font-weight: 400; color: var(--primary); }
.login-logo strong { font-weight: 800; }
.login-logo em { font-style: normal; color: var(--accent); font-weight: 800; }
.login-card h2 { text-align: center; font-size: 1.4rem; margin-bottom: 4px; }
.login-sub { text-align: center; color: var(--text-light); font-size: 0.9rem; margin-bottom: 32px; }
.form-group { margin-bottom: 18px; }
.form-group label { display: block; font-size: 0.85rem; font-weight: 600; margin-bottom: 6px; color: var(--text-light); }
.form-group label i { margin-right: 6px; }
.form-group input, .form-group select, .form-group textarea {
  width: 100%; padding: 12px 16px; border: 1.5px solid var(--border); border-radius: 8px;
  font-size: 0.97rem; transition: border-color .2s;
}
.form-group input:focus, .form-group select:focus, .form-group textarea:focus {
  outline: none; border-color: var(--primary);
}
.input-icon { position: relative; }
.input-icon input { padding-right: 44px; }
.input-icon button { position: absolute; right: 12px; top: 50%; transform: translateY(-50%); background: none; border: none; cursor: pointer; color: var(--text-light); }
.btn-login {
  width: 100%; padding: 14px; background: var(--primary); color: white;
  border: none; border-radius: 10px; font-size: 1rem; font-weight: 700; cursor: pointer;
  margin-top: 8px; transition: background .2s; display: flex; align-items: center; justify-content: center; gap: 8px;
}
.btn-login:hover { background: var(--primary-dark); }
.back-link { display: block; text-align: center; margin-top: 20px; font-size: 0.87rem; color: var(--text-light); }
.back-link:hover { color: var(--primary); }
.alert { padding: 12px 16px; border-radius: 8px; margin-bottom: 18px; font-size: 0.9rem; }
.alert-error { background: #fde8e8; color: var(--red); border: 1px solid #f5c6c6; }
.alert-success { background: #e8f5e9; color: var(--green); border: 1px solid #c8e6c9; }

/* ===== DASHBOARD LAYOUT ===== */
.admin-layout { display: flex; min-height: 100vh; }

/* ===== SIDEBAR ===== */
.sidebar {
  width: var(--sidebar-w);
  background: #0d1b2a;
  position: fixed;
  top: 0;
  left: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  z-index: 100;
  overflow: hidden;
  transition: transform .3s;
}
.sidebar__logo {
  padding: 28px 24px 20px;
  border-bottom: 1px solid #1e2d3d;
  font-size: 1.2rem;
  color: white;
  font-weight: 400;
  flex-shrink: 0;
}
.sidebar__logo strong { font-weight: 800; }
.sidebar__logo em { font-style: normal; color: var(--accent); font-weight: 800; }

.sidebar__menu {
  flex: 1;
  overflow-y: auto;
  padding: 16px 0;
  min-height: 0;
  scrollbar-width: none;
}
.sidebar__menu::-webkit-scrollbar { display: none; }

.sidebar__item {
  display: flex; align-items: center; gap: 12px; padding: 12px 24px;
  color: #9aacbe; cursor: pointer; transition: all .2s; border-left: 3px solid transparent;
  text-decoration: none; font-size: 0.92rem;
}
.sidebar__item:hover, .sidebar__item.active {
  color: white; background: rgba(255,255,255,0.06); border-left-color: var(--accent);
}
.sidebar__item i { width: 20px; text-align: center; font-size: 1rem; }

.sidebar__section {
  padding: 12px 24px 4px;
  font-size: 0.7rem;
  color: #4a6177;
  text-transform: uppercase;
  letter-spacing: 1px;
  pointer-events: none;
  user-select: none;
}

.sidebar__footer {
  padding: 20px 24px;
  border-top: 1px solid #1e2d3d;
  flex-shrink: 0;
}
.sidebar__user { display: flex; align-items: center; gap: 12px; }
.sidebar__avatar {
  width: 38px; height: 38px; border-radius: 50%; background: var(--primary);
  display: flex; align-items: center; justify-content: center;
  color: white; font-weight: 700; font-size: 1rem;
}
.sidebar__user-info small { display: block; color: #6a8095; font-size: 0.75rem; }
.sidebar__user-name { color: white; font-size: 0.88rem; font-weight: 600; }
.btn-logout { background: none; border: none; color: #6a8095; cursor: pointer; font-size: 1rem; margin-left: auto; transition: color .2s; }
.btn-logout:hover { color: #ef5350; }

/* ===== MAIN CONTENT ===== */
.main-content { margin-left: var(--sidebar-w); flex: 1; display: flex; flex-direction: column; }
.topbar {
  background: var(--white); padding: 16px 32px; display: flex; align-items: center;
  justify-content: space-between; box-shadow: 0 1px 8px rgba(0,0,0,0.06);
  position: sticky; top: 0; z-index: 50;
}
.topbar__title { font-size: 1.15rem; font-weight: 700; }
.topbar__right { display: flex; align-items: center; gap: 16px; }
.page-content { padding: 32px; flex: 1; }

/* ===== STATS CARDS ===== */
.stats-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 20px; margin-bottom: 32px; }
.stat-card {
  background: var(--white); border-radius: var(--radius); padding: 24px;
  box-shadow: var(--shadow); display: flex; align-items: center; gap: 18px;
}
.stat-icon { width: 54px; height: 54px; border-radius: 14px; display: flex; align-items: center; justify-content: center; font-size: 1.4rem; color: white; flex-shrink: 0; }
.stat-info h3 { font-size: 1.8rem; font-weight: 800; }
.stat-info p { font-size: 0.85rem; color: var(--text-light); }

/* ===== DATA TABLE ===== */
.card { background: var(--white); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; margin-bottom: 24px; }
.card__header { padding: 20px 24px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--border); }
.card__header h3 { font-size: 1rem; font-weight: 700; }
.card__body { padding: 0; }
.data-table { width: 100%; border-collapse: collapse; }
.data-table th { padding: 12px 20px; text-align: left; font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.5px; color: var(--text-light); border-bottom: 1px solid var(--border); background: #fafafa; }
.data-table td { padding: 14px 20px; font-size: 0.9rem; border-bottom: 1px solid #f0f0f0; vertical-align: middle; }
.data-table tr:last-child td { border-bottom: none; }
.data-table tr:hover td { background: #f9fbff; }
.badge { display: inline-block; padding: 3px 10px; border-radius: 20px; font-size: 0.75rem; font-weight: 600; }
.badge-green { background: #e8f5e9; color: var(--green); }
.badge-red { background: #fde8e8; color: var(--red); }
.badge-blue { background: #e3f2fd; color: var(--primary); }
.badge-orange { background: #fff3e0; color: #e65100; }

/* ===== BUTTONS ===== */
.btn { display: inline-flex; align-items: center; gap: 7px; padding: 9px 18px; border-radius: 8px; font-size: 0.88rem; font-weight: 600; cursor: pointer; border: none; transition: all .2s; }
.btn-sm { padding: 6px 12px; font-size: 0.8rem; }
.btn-primary { background: var(--primary); color: white; }
.btn-primary:hover { background: var(--primary-dark); }
.btn-danger { background: var(--red); color: white; }
.btn-danger:hover { background: #b71c1c; }
.btn-success { background: var(--green); color: white; }
.btn-success:hover { background: #1b5e20; }
.btn-outline { background: transparent; border: 1.5px solid var(--border); color: var(--text-light); }
.btn-outline:hover { border-color: var(--primary); color: var(--primary); }
.btn-warning { background: #f57c00; color: white; }

/* ===== MODAL ===== */
.modal-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.5); z-index: 500; display: none; align-items: center; justify-content: center; }
.modal-overlay.open { display: flex; }
.modal { background: var(--white); border-radius: 16px; width: 100%; max-width: 560px; max-height: 90vh; overflow-y: auto; box-shadow: 0 20px 60px rgba(0,0,0,0.3); }
.modal__header { padding: 20px 24px; border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; }
.modal__header h3 { font-size: 1.1rem; font-weight: 700; }
.modal__body { padding: 24px; }
.modal__footer { padding: 16px 24px; border-top: 1px solid var(--border); display: flex; justify-content: flex-end; gap: 12px; }
.btn-close { background: none; border: none; font-size: 1.3rem; cursor: pointer; color: var(--text-light); }
.row { display: flex; gap: 16px; }
.row .form-group { flex: 1; }

/* ===== PAGINATION ===== */
.pagination { display: flex; gap: 8px; align-items: center; justify-content: center; padding: 20px; }
.page-btn { padding: 8px 14px; border-radius: 8px; border: 1px solid var(--border); background: var(--white); cursor: pointer; font-size: 0.87rem; }
.page-btn.active { background: var(--primary); color: white; border-color: var(--primary); }

/* ===== TABS ===== */
.tab-nav { display: flex; gap: 4px; border-bottom: 2px solid var(--border); margin-bottom: 24px; }
.tab-btn { padding: 10px 20px; border: none; background: none; font-size: 0.92rem; cursor: pointer; color: var(--text-light); border-bottom: 3px solid transparent; margin-bottom: -2px; }
.tab-btn.active { color: var(--primary); border-bottom-color: var(--primary); font-weight: 700; }

/* ===== SEARCH BAR ===== */
.search-bar { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.search-bar input { padding: 9px 16px; border: 1.5px solid var(--border); border-radius: 8px; font-size: 0.9rem; min-width: 220px; }
.search-bar input:focus { outline: none; border-color: var(--primary); }

/* ===== STATUS SELECT ===== */
select.status-sel { padding: 6px 10px; border-radius: 6px; border: 1px solid var(--border); font-size: 0.82rem; }

/* ===== EMPTY STATE ===== */
.empty-state { text-align: center; padding: 60px 20px; color: var(--text-light); }
.empty-state i { font-size: 3rem; margin-bottom: 16px; display: block; opacity: .3; }

/* ===== TOGGLE ===== */
.toggle { position: relative; display: inline-block; width: 44px; height: 24px; }
.toggle input { opacity: 0; width: 0; height: 0; }
.toggle-slider { position: absolute; inset: 0; background: #ccc; border-radius: 24px; cursor: pointer; transition: .3s; }
.toggle-slider::before { content: ''; position: absolute; width: 18px; height: 18px; left: 3px; top: 3px; background: white; border-radius: 50%; transition: .3s; }
.toggle input:checked + .toggle-slider { background: var(--green); }
.toggle input:checked + .toggle-slider::before { transform: translateX(20px); }

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar.open { transform: none; }
  .main-content { margin-left: 0; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .page-content { padding: 16px; }
}