/* ==============================
   ESCALA DE PREGAÇÃO - Styles
   ============================== */

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

:root {
  --primary: #4f46e5;
  --primary-dark: #3730a3;
  --primary-light: #e0e7ff;
  --success: #16a34a;
  --success-light: #dcfce7;
  --danger: #dc2626;
  --danger-light: #fee2e2;
  --warning: #d97706;
  --gray-50: #f9fafb;
  --gray-100: #f3f4f6;
  --gray-200: #e5e7eb;
  --gray-300: #d1d5db;
  --gray-500: #6b7280;
  --gray-700: #374151;
  --gray-900: #111827;
  --white: #ffffff;
  --sidebar-w: 240px;
  --radius: 10px;
  --shadow: 0 1px 3px rgba(0,0,0,0.1), 0 1px 2px rgba(0,0,0,0.06);
  --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.1);
}

body { font-family: 'Segoe UI', system-ui, -apple-system, sans-serif; color: var(--gray-700); background: var(--gray-50); }
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ---- CONTAINER ---- */
.container { max-width: 1100px; margin: 0 auto; padding: 0 20px; }

/* ---- BUTTONS ---- */
.btn { display: inline-flex; align-items: center; gap: 6px; padding: 8px 16px; border-radius: 8px; font-size: 14px; font-weight: 500; cursor: pointer; border: none; transition: all .15s; text-decoration: none; }
.btn:hover { text-decoration: none; opacity: .9; }
.btn-primary { background: var(--primary); color: var(--white); }
.btn-primary:hover { background: var(--primary-dark); }
.btn-outline { background: transparent; color: var(--primary); border: 1px solid var(--primary); }
.btn-outline:hover { background: var(--primary-light); }
.btn-danger { background: var(--danger); color: var(--white); }
.btn-sm { padding: 6px 12px; font-size: 13px; }
.btn-xs { padding: 4px 8px; font-size: 12px; }
.btn-full { width: 100%; justify-content: center; }

/* ---- ALERTS ---- */
.alert { padding: 12px 16px; border-radius: var(--radius); margin-bottom: 16px; font-size: 14px; }
.alert-success { background: var(--success-light); color: var(--success); border: 1px solid #bbf7d0; }
.alert-error { background: var(--danger-light); color: var(--danger); border: 1px solid #fecaca; }

/* ---- BADGES ---- */
.badge { display: inline-block; padding: 2px 10px; border-radius: 99px; font-size: 12px; font-weight: 600; }
.badge-success { background: var(--success-light); color: var(--success); }
.badge-gray { background: var(--gray-100); color: var(--gray-500); }
.badge-purple { background: #ede9fe; color: #7c3aed; }
.badge-blue { background: #dbeafe; color: #2563eb; }

/* ---- LANG SWITCHER ---- */
.lang-switcher { display: flex; gap: 4px; }
.lang-btn { padding: 4px 10px; border-radius: 6px; font-size: 12px; border: 1px solid var(--gray-200); background: var(--white); color: var(--gray-700); text-decoration: none; transition: all .15s; }
.lang-btn.active { background: var(--primary); color: var(--white); border-color: var(--primary); }
.lang-btn:hover { text-decoration: none; background: var(--primary-light); }

/* ==============================
   PUBLIC PAGES
   ============================== */
.public-body { background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); min-height: 100vh; }

.public-header { background: rgba(255,255,255,.15); backdrop-filter: blur(10px); border-bottom: 1px solid rgba(255,255,255,.2); padding: 16px 0; }
.header-inner { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.brand { display: flex; align-items: center; gap: 12px; color: var(--white); }
.brand-icon { font-size: 28px; }
.brand h1 { font-size: 20px; font-weight: 700; }
.brand p { font-size: 13px; opacity: .8; }
.header-actions { display: flex; align-items: center; gap: 12px; }

.public-main { padding: 40px 0 60px; }

.public-footer { text-align: center; padding: 24px; color: rgba(255,255,255,.6); font-size: 13px; }

/* Public schedule */
.public-schedule { }
.page-hero { text-align: center; color: var(--white); margin-bottom: 40px; }
.page-hero h2 { font-size: 32px; font-weight: 700; }
.page-hero p { margin-top: 8px; opacity: .85; font-size: 16px; }

.schedule-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 20px; }

.schedule-card { background: var(--white); border-radius: 16px; overflow: hidden; box-shadow: var(--shadow-md); transition: transform .2s; }
.schedule-card:hover { transform: translateY(-2px); }
.card-today { border: 2px solid #fbbf24; }

.card-date { background: var(--primary); color: var(--white); padding: 20px; text-align: center; position: relative; }
.date-weekday { display: block; font-size: 12px; text-transform: uppercase; letter-spacing: 2px; opacity: .8; }
.date-day { display: block; font-size: 48px; font-weight: 800; line-height: 1; }
.date-month { display: block; font-size: 13px; opacity: .9; margin-top: 4px; }
.today-badge { display: inline-block; background: #fbbf24; color: #92400e; padding: 2px 10px; border-radius: 99px; font-size: 11px; font-weight: 700; margin-top: 8px; }

.card-body { padding: 20px; }
.card-row { display: flex; align-items: flex-start; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--gray-100); }
.card-row:last-child { border-bottom: none; }
.row-label { font-size: 12px; color: var(--gray-500); min-width: 140px; font-weight: 500; }
.row-value { font-size: 14px; font-weight: 600; color: var(--gray-900); }
.card-notes { margin-top: 12px; font-size: 13px; color: var(--gray-500); font-style: italic; border-top: 1px solid var(--gray-100); padding-top: 10px; }

/* Login */
.login-wrapper { display: flex; align-items: center; justify-content: center; min-height: 60vh; padding: 40px 0; }
.login-card { background: var(--white); border-radius: 20px; padding: 40px; width: 100%; max-width: 400px; box-shadow: 0 20px 60px rgba(0,0,0,.2); }
.login-header { text-align: center; margin-bottom: 32px; }
.login-icon { font-size: 40px; }
.login-header h2 { font-size: 22px; margin-top: 12px; color: var(--gray-900); }
.login-header p { color: var(--gray-500); font-size: 14px; }
.login-hint { text-align: center; margin-top: 16px; color: var(--gray-500); font-size: 12px; }

/* ==============================
   ADMIN LAYOUT
   ============================== */
.admin-body { display: flex; min-height: 100vh; background: var(--gray-100); }

.sidebar { width: var(--sidebar-w); background: var(--gray-900); color: var(--white); display: flex; flex-direction: column; position: fixed; top: 0; left: 0; height: 100vh; z-index: 100; transition: transform .3s; }
.sidebar-header { display: flex; align-items: center; gap: 10px; padding: 20px 16px; border-bottom: 1px solid rgba(255,255,255,.1); font-size: 15px; font-weight: 700; }
.sidebar-header .brand-icon { font-size: 22px; }

.sidebar-nav { flex: 1; padding: 12px 8px; overflow-y: auto; }
.nav-item { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 8px; color: rgba(255,255,255,.7); font-size: 14px; margin-bottom: 2px; transition: all .15s; text-decoration: none; }
.nav-item:hover, .nav-item.active { background: rgba(255,255,255,.1); color: var(--white); text-decoration: none; }
.nav-icon { font-size: 16px; width: 20px; text-align: center; }
.nav-divider { border: none; border-top: 1px solid rgba(255,255,255,.1); margin: 8px 0; }

.sidebar-footer { padding: 16px; border-top: 1px solid rgba(255,255,255,.1); }
.user-info { display: flex; align-items: center; gap: 10px; }
.user-avatar { width: 36px; height: 36px; border-radius: 50%; background: var(--primary); display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 15px; flex-shrink: 0; }
.user-details strong { display: block; font-size: 13px; color: var(--white); }
.user-details small { font-size: 11px; color: rgba(255,255,255,.5); }

.admin-content { margin-left: var(--sidebar-w); flex: 1; display: flex; flex-direction: column; min-height: 100vh; }

.topbar { height: 60px; background: var(--white); border-bottom: 1px solid var(--gray-200); display: flex; align-items: center; justify-content: space-between; padding: 0 24px; position: sticky; top: 0; z-index: 50; box-shadow: var(--shadow); }
.topbar-right { display: flex; align-items: center; gap: 12px; }
.sidebar-toggle { background: none; border: none; font-size: 20px; cursor: pointer; display: none; }

.page-content { padding: 24px; flex: 1; }

/* ---- PAGE HEADER ---- */
.page-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 24px; flex-wrap: wrap; gap: 12px; }
.page-header h2 { font-size: 22px; font-weight: 700; color: var(--gray-900); }
.page-header p { color: var(--gray-500); font-size: 14px; margin-top: 2px; }
.page-actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* ---- STATS ---- */
.stats-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 16px; margin-bottom: 24px; }
.stat-card { background: var(--white); border-radius: var(--radius); padding: 20px; display: flex; align-items: center; gap: 16px; box-shadow: var(--shadow); }
.stat-highlight { border-left: 4px solid var(--primary); }
.stat-icon { font-size: 28px; }
.stat-number { display: block; font-size: 28px; font-weight: 700; color: var(--gray-900); }
.stat-label { font-size: 12px; color: var(--gray-500); }

/* ---- DASHBOARD ---- */
.dashboard-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.dashboard-panel { background: var(--white); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow); }
.panel-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.panel-header h3 { font-size: 15px; font-weight: 600; }
.quick-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.action-btn { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 16px 12px; border-radius: 10px; border: 1px solid var(--gray-200); background: var(--gray-50); text-align: center; transition: all .15s; text-decoration: none; color: var(--gray-700); font-size: 13px; }
.action-btn:hover { background: var(--primary-light); border-color: var(--primary); text-decoration: none; }
.action-btn span { font-size: 24px; }

/* ---- TABLES ---- */
.table-wrapper { background: var(--white); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th { background: var(--gray-50); padding: 12px 16px; text-align: left; font-size: 12px; font-weight: 600; color: var(--gray-500); text-transform: uppercase; letter-spacing: .5px; border-bottom: 1px solid var(--gray-200); }
.table td { padding: 12px 16px; border-bottom: 1px solid var(--gray-100); vertical-align: middle; }
.table tr:last-child td { border-bottom: none; }
.table tr:hover td { background: var(--gray-50); }
.actions-cell { white-space: nowrap; display: flex; gap: 6px; }
.empty-text { color: var(--gray-500); font-size: 14px; text-align: center; padding: 24px 0; }

/* ---- FORMS ---- */
.form-card { background: var(--white); border-radius: var(--radius); padding: 28px; box-shadow: var(--shadow); max-width: 720px; }
.form-group { margin-bottom: 18px; }
.form-group label { display: block; font-size: 13px; font-weight: 600; color: var(--gray-700); margin-bottom: 6px; }
.form-group input, .form-group select, .form-group textarea {
  width: 100%; padding: 10px 14px; border: 1px solid var(--gray-300); border-radius: 8px; font-size: 14px;
  background: var(--white); color: var(--gray-900); transition: border-color .15s;
  font-family: inherit;
}
.form-group input:focus, .form-group select:focus, .form-group textarea:focus {
  outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(79,70,229,.1);
}
.form-check label { display: flex; align-items: center; gap: 8px; font-weight: 500; cursor: pointer; }
.form-check input[type="checkbox"] { width: auto; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-actions { display: flex; gap: 10px; margin-top: 24px; }
.form-hint { font-size: 12px; color: var(--gray-500); margin-top: 4px; }

/* ---- EMPTY STATE ---- */
.empty-state { text-align: center; padding: 60px 20px; background: var(--white); border-radius: var(--radius); }
.empty-icon { font-size: 48px; display: block; margin-bottom: 12px; }
.empty-state p { color: var(--gray-500); margin-bottom: 20px; }

/* ---- CALENDAR ---- */
.calendar-wrapper { background: var(--white); border-radius: var(--radius); padding: 24px; box-shadow: var(--shadow); }
.calendar-nav { display: flex; align-items: center; justify-content: center; gap: 20px; margin-bottom: 24px; }
.calendar-nav h3 { font-size: 18px; font-weight: 700; min-width: 200px; text-align: center; }

.cal-weekdays { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; margin-bottom: 4px; }
.cal-wd { text-align: center; font-size: 12px; font-weight: 600; color: var(--gray-500); padding: 8px 0; text-transform: uppercase; }

.cal-days { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.cal-day { min-height: 80px; border-radius: 8px; border: 1px solid var(--gray-100); padding: 6px; position: relative; background: var(--gray-50); transition: all .15s; }
.cal-day:hover { border-color: var(--primary); }
.cal-empty { background: transparent; border-color: transparent; }
.cal-today { background: var(--primary-light); border-color: var(--primary); }
.cal-has-event { background: var(--white); border-color: var(--primary); }
.cal-num { font-size: 13px; font-weight: 600; color: var(--gray-700); display: block; margin-bottom: 4px; }
.cal-today .cal-num { color: var(--primary); }

.cal-event { font-size: 11px; line-height: 1.3; }
.cal-event a { color: var(--primary); font-weight: 500; text-decoration: none; display: block; background: var(--primary-light); padding: 2px 5px; border-radius: 4px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.cal-add-btn { display: none; position: absolute; bottom: 4px; right: 4px; width: 22px; height: 22px; border-radius: 50%; background: var(--primary); color: var(--white); text-align: center; line-height: 22px; font-size: 16px; text-decoration: none; font-weight: 700; }
.cal-day:hover .cal-add-btn { display: block; }

/* ---- RESPONSIVE ---- */
@media (max-width: 768px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar.open { transform: translateX(0); }
  .admin-content { margin-left: 0; }
  .sidebar-toggle { display: block; }
  .dashboard-grid { grid-template-columns: 1fr; }
  .form-row { grid-template-columns: 1fr; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .schedule-grid { grid-template-columns: 1fr; }
  .cal-day { min-height: 55px; }
  .cal-event a { display: none; }
}

@media (max-width: 480px) {
  .page-content { padding: 16px; }
  .form-card { padding: 20px; }
  .stats-grid { grid-template-columns: 1fr 1fr; }
  .header-inner { flex-direction: column; align-items: flex-start; gap: 10px; }
}
