/* ====== GENERAL VARIABLES (Matched to Reference) ====== */
:root {
  --bg-page: #f5f5f7;
  --bg-card: #ffffff;
  --accent: #946F41;
  --accent-hover: #7a5b35;
  --accent-soft: rgba(148, 111, 65, 0.1);
  --text-main: #151515;
  --text-muted: #6c6c70;
  --border-soft: #e1e1e4;
  --radius-lg: 18px;
  --radius-md: 10px;
  --shadow-soft: 0 14px 30px rgba(15, 23, 42, 0.08);
  --transition-fast: 0.18s ease-out;
  --danger: #dc3545;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

.clickable-row {
    cursor: pointer;
}

body {
  font-family: "DM Sans", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 16px;              
  color: var(--text-main);
  background: var(--bg-page);
  min-height: 100vh;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 40px 16px;
}

/* ====== LAYOUT COMPONENTS ====== */

.app-shell {
  width: 100%;
  max-width: 1100px; /* Slightly wider for admin table */
  display: flex;
  flex-direction: column;
  gap: 22px;
}

.login-shell {
    max-width: 450px;
    align-items: center;
    margin-top: 5vh;
}

.card {
    background: var(--bg-card);
    padding: 28px 26px;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-soft);
}

.login-card {
    width: 100%;
}

/* ====== HEADER ====== */

.app-header {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 10px;
}

.header-flex {
    flex-direction: row;
    justify-content: space-between;
    align-items: flex-start;
    border-bottom: 1px solid var(--border-soft);
    padding-bottom: 20px;
    margin-bottom: 20px;
}

.badge-year {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px; 
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  font-weight: 600;
  margin-bottom: 5px;
}

.badge-dot {
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: var(--accent);
  animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { opacity: 1; }
    50% { opacity: 0.4; }
    100% { opacity: 1; }
}

.title-main {
  font-family: "Funnel Display", system-ui, sans-serif;
  font-weight: 700;
  font-size: 32px;   
  letter-spacing: 0.01em;
  line-height: 1.1;
}

.subtitle {
  font-size: 16px;   
  color: var(--text-muted);
}

/* ====== STATS GRID ====== */

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
    margin-bottom: 10px;
}

.stat-card h3 {
    font-family: "Funnel Display", system-ui, sans-serif;
    font-size: 16px;
    color: var(--text-muted);
    font-weight: 500;
    margin-bottom: 10px;
}

.stat-card p {
    font-size: 42px;
    font-weight: 700;
    color: var(--accent);
    font-family: "Funnel Display", system-ui, sans-serif;
    line-height: 1;
    margin-bottom: 5px;
}

.stat-card .muted-inline {
    font-size: 14px;
    color: var(--text-muted);
}

/* Notifications List */
#notifications {
    list-style: none;
    max-height: 100px;
    overflow-y: auto;
}

#notifications li {
    font-size: 14px;
    padding: 6px 0;
    border-bottom: 1px dashed var(--border-soft);
}
#notifications li:last-child { border-bottom: none; }

/* ====== FORMS & INPUTS ====== */

.form-grid {
  display: grid;
  gap: 16px;
  margin-top: 20px;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.field label {
  font-family: "Funnel Display", system-ui, sans-serif;
  font-size: 15px;   
  font-weight: 500;
}

.field input {
  font-family: "DM Sans", system-ui, sans-serif;
  padding: 12px 14px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-soft);
  font-size: 16px;  
  background: #fbfbfc;
  width: 100%;
  transition: all var(--transition-fast);
}

.field input:focus {
  outline: none;
  border-color: var(--accent);
  background: #ffffff;
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.info-block {
  background: #f8f9fd;
  padding: 12px;
  border-radius: var(--radius-md);
  font-size: 14px;
}

.error-block {
    background: #fdf2f2;
    color: #c53030;
    border: 1px solid #fc8181;
}

/* ====== BUTTONS ====== */

.btn {
  border: none;
  border-radius: 999px;
  padding: 10px 24px;
  font-family: "DM Sans", system-ui, sans-serif;
  font-size: 16px;   
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition-fast);
  text-decoration: none;
}

.btn-primary {
  background: var(--accent);
  color: #ffffff;
}

.btn-primary:hover {
  background: var(--accent-hover);
  transform: translateY(-1px);
}

.btn-ghost {
  background: transparent;
  border: 1px solid var(--border-soft);
  color: var(--text-muted);
}

.btn-ghost:hover {
  background: #f5f5f7;
  color: var(--danger);
  border-color: #eecbcb;
}

.btn-sm {
    padding: 6px 16px;
    font-size: 14px;
}

/* ====== TABLES ====== */

.table-card {
    padding: 0; /* Remove padding for full-width table look */
    overflow: hidden;
}

.table-card .section-title {
    padding: 26px 26px 10px;
    margin: 0;
    font-size: 22px;
}

.table-responsive {
    width: 100%;
    overflow-x: auto;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 10px;
    font-size: 15px;
}

.data-table th {
    background: var(--bg-page);
    color: var(--text-muted);
    font-weight: 600;
    text-align: left;
    padding: 12px 26px;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-bottom: 1px solid var(--border-soft);
    border-top: 1px solid var(--border-soft);
}

.data-table td {
    padding: 16px 26px;
    border-bottom: 1px solid var(--border-soft);
    color: var(--text-main);
}

.data-table tr:last-child td {
    border-bottom: none;
}

.data-table tr:hover td {
    background: #fbfbfc;
}

.ip-badge {
    background: #f0f0f0;
    padding: 2px 6px;
    border-radius: 4px;
    font-family: monospace;
    font-size: 12px;
    color: #555;
}

/* ====== PAGINATION ====== */

.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 6px;
    padding: 20px;
    background: var(--bg-card);
}

.page-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 8px;
    border: 1px solid var(--border-soft);
    text-decoration: none;
    color: var(--text-main);
    font-weight: 500;
    transition: all 0.2s;
    font-size: 14px;
}

.page-link:hover {
    background: var(--bg-page);
    border-color: var(--accent);
    color: var(--accent);
}

.page-link.current {
    background: var(--accent);
    color: white;
    border-color: var(--accent);
}

/* ====== RESPONSIVE ====== */

@media (max-width: 768px) {
    .header-flex {
        flex-direction: column;
        gap: 15px;
    }
    
    .data-table th, .data-table td {
        padding: 12px 16px;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
}