:root {
  --bg-light: #f4f6f9;
  --bg-panel: #ffffff;
  --border: #e0e6ed;
  --text-main: #333333;
  --text-muted: #666666;
  --primary: #003a70;
  --accent: #ec6608;
  --accent-hover: #d15600;
  --danger: #dc3545;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
body { 
  font-family: 'Montserrat', sans-serif; 
  background-color: var(--bg-light); 
  color: var(--text-main); 
  min-height: 100vh; 
  overflow-x: hidden; 
}

h1, h2, h3 {
  font-weight: 700;
  color: var(--primary);
}

/* Utils */
.hidden { display: none !important; }
.container { 
  width: 100%; max-width: 1000px; 
  padding: 3rem 2rem; margin: 0 auto; 
  display: flex; flex-direction: column; 
  justify-content: center; min-height: 80vh; 
  animation: fadeIn 0.4s ease-in-out; 
}
@keyframes fadeIn { from{opacity:0; transform: translateY(10px);} to{opacity:1; transform: translateY(0);} }

/* Nav */
.top-nav { 
  width: 100%; padding: 1rem 3rem; 
  display: flex; justify-content: space-between; 
  align-items: center; background: var(--bg-panel);
  box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}
.nav-brand { font-size: 1.3rem; color: var(--primary); font-weight: 700; text-transform: uppercase;}
.nav-actions { display: flex; gap: 1rem; align-items: center; }
#user-display { color: var(--text-muted); font-size: 0.9rem; font-weight: 500;}
.nav-btn { 
  background: var(--bg-light); border: none; border-radius: 20px;
  color: var(--primary); font-size: 0.85rem; font-weight: 600; padding: 0.6rem 1.2rem;
  cursor: pointer; transition: all 0.3s; 
}
.nav-btn:hover { background: var(--primary); color: white; }

/* Headers */
header { text-align: center; margin-bottom: 3rem; }
header h1 { font-size: 2.5rem; margin-bottom: 0.8rem; }
header p { color: var(--text-muted); font-size: 1.1rem; }

/* Boxes */
.minimal-box { max-width: 420px; margin: 0 auto; width: 100%; }
.border-box { 
  border-radius: 12px; padding: 3rem 2.5rem; background: var(--bg-panel); 
  box-shadow: 0 8px 30px rgba(0,0,0,0.05); border: 1px solid var(--border);
}
.minimal-box h2 { font-size: 1.8rem; margin-bottom: 0.5rem; text-align: center; color: var(--primary);}
.divider { width: 60px; height: 3px; background: var(--accent); margin: 1rem auto 2.5rem; border-radius: 2px;}

.input-group { margin-bottom: 1.5rem; text-align: left; }
.input-group label { display: block; font-size: 0.85rem; color: var(--text-muted); margin-bottom: 0.5rem; font-weight: 600;}
input, select { 
  width: 100%; padding: 0.9rem 1rem; border-radius: 8px;
  background: var(--bg-light); border: 1px solid var(--border); 
  color: var(--text-main); font-family: inherit; font-size: 1rem; 
  transition: all 0.3s;
}
input:focus, select:focus { outline: none; border-color: var(--accent); background: white; box-shadow: 0 0 0 3px rgba(236,102,8,0.1); }

.checkbox-group { display: flex; flex-wrap: wrap; gap: 1rem; padding: 0.5rem 0;}
.checkbox-group label { display: flex; align-items: center; gap: 0.4rem; font-size: 0.9rem; font-weight: 500; color: var(--text-main); text-transform: none; letter-spacing: 0; cursor: pointer; margin-bottom: 0;}
.checkbox-group input[type="checkbox"] { width: auto; cursor: pointer; transform: scale(1.1); margin: 0;}

.action-row { text-align: center; margin-top: 2rem; }
.minimal-btn { 
  background: var(--accent); border: none; border-radius: 25px;
  color: white; padding: 0.9rem 2.5rem; font-weight: 600; text-transform: none;
  font-family: inherit; font-size: 1rem; cursor: pointer; transition: all 0.3s; 
  box-shadow: 0 4px 10px rgba(236,102,8,0.3);
}
.minimal-btn:hover { background: var(--accent-hover); transform: translateY(-2px); box-shadow: 0 6px 15px rgba(236,102,8,0.4);}
.error-msg { color: var(--danger); margin-top: 1rem; font-size: 0.85rem; text-align: center; font-weight: 600;}
.msg { color: #28a745; margin-top: 1.5rem; font-size: 0.85rem; text-align: center; font-weight: 600;}

/* Cards */
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 2rem; }
.card { height: 320px; perspective: 1200px; position: relative; }
.card-front, .card-back { 
  position: absolute; width: 100%; height: 100%; 
  backface-visibility: hidden; padding: 2rem; 
  display: flex; flex-direction: column; justify-content: center; 
  align-items: center; text-align: center; 
  background: var(--bg-panel); border-radius: 12px;
  box-shadow: 0 4px 15px rgba(0,0,0,0.06); border: 1px solid transparent;
  transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.3s; 
}
.card-front { border-bottom: 4px solid var(--primary); }
.card-back { transform: rotateY(180deg); border-bottom: 4px solid var(--accent); }
.card.flipped .card-front { transform: rotateY(180deg); }
.card.flipped .card-back { transform: rotateY(360deg); }
.card:hover .card-front { box-shadow: 0 10px 30px rgba(0,0,0,0.1); cursor: pointer; transform: translateY(-3px); border-bottom-color: var(--accent); }

.card h3 { font-size: 1.5rem; margin-bottom: 0.5rem; color: var(--primary); }
.card .subtitle { color: var(--text-muted); font-size: 0.95rem; line-height: 1.5;}
.sub-links { display: flex; flex-direction: column; gap: 0.8rem; width: 100%; margin-bottom: 2rem; }
.minimal-link { 
  text-decoration: none; color: var(--primary); font-weight: 600;
  font-size: 0.95rem; transition: all 0.3s;
  padding: 0.8rem; background: var(--bg-light); border-radius: 8px;
}
.minimal-link:hover { color: white; background: var(--accent); }
.text-btn { background: none; border: none; color: var(--text-muted); font-size: 0.9rem; font-weight: 600; cursor: pointer; transition: color 0.3s; text-decoration: underline;}
.text-btn:hover { color: var(--primary); }

/* Admin Panel */
.admin-grid { display: grid; grid-template-columns: 1fr 1.5fr; gap: 2rem; align-items: start; }
@media (max-width: 800px) { .admin-grid { grid-template-columns: 1fr; } }
.box-title { font-size: 1.4rem; margin-bottom: 1.5rem; color: var(--primary); border-bottom: 2px solid var(--accent); padding-bottom: 0.8rem; text-align: left; display: inline-block;}

table { width: 100%; border-collapse: collapse; font-size: 0.95rem; }
th, td { padding: 1.2rem 1rem; text-align: left; border-bottom: 1px solid var(--border); }
th { color: var(--primary); font-weight: 700; background: var(--bg-light); border-radius: 8px 8px 0 0;}
td { color: var(--text-main); font-weight: 500;}
.del-btn { background: var(--danger); color: white; border: none; padding: 0.5rem 1rem; border-radius: 6px; font-size: 0.85rem; font-weight: 600; cursor: pointer; transition: background 0.3s; }
.del-btn:hover { background: #b02a37; }
