/* Soci-App - Base Styles */

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

:root {
  --primary: #003d95;
  --secondary: #64748b;
  --success: #10b981;
  --warning: #f59e0b;
  --error: #ef4444;
  --bg: #f8fafc;
  --text: #1e293b;
  --border: #e2e8f0;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 15px;
}

.container h1 {
  margin-bottom: 15px;
  font-size: 28px;
}

/* Header */
.header {
  background: white;
  border-bottom: 1px solid var(--border);
  padding: 15px 0;
  margin-bottom: 30px;
}

.header-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.logo a {
  text-decoration: none;
  color: var(--primary);
  font-size: 24px;
  font-weight: 700;
}

.nav {
  display: flex;
  gap: 20px;
  align-items: center;
}

.nav a {
  text-decoration: none;
  color: var(--text);
  font-weight: 500;
}

.nav a:hover {
  color: var(--primary);
}

.nav-link-with-badge {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.notification-badge {
  background: #ef4444;
  color: white;
  font-size: 11px;
  font-weight: 600;
  padding: 2px 6px;
  border-radius: 10px;
  min-width: 18px;
  text-align: center;
  line-height: 1.2;
}

.user-menu {
  position: relative;
}

.user-button {
  background: white;
  border: 1px solid var(--border);
  padding: 8px 16px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 14px;
}

.role-badge {
  background: var(--primary);
  color: white;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 11px;
  margin-left: 8px;
}

.dropdown {
  position: absolute;
  top: 100%;
  right: 0;
  background: white;
  border: 1px solid var(--border);
  border-radius: 6px;
  margin-top: 5px;
  min-width: 150px;
  box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

.dropdown a {
  display: block;
  padding: 10px 15px;
  text-decoration: none;
  color: var(--text);
}

.dropdown a:hover {
  background: var(--bg);
}

/* Footer */
.footer {
  background: white;
  border-top: 1px solid var(--border);
  padding: 20px 0;
  margin-top: 50px;
  text-align: center;
  color: var(--secondary);
  font-size: 14px;
}

/* Buttons */
.btn {
  display: inline-block;
  padding: 10px 20px;
  border-radius: 6px;
  text-decoration: none;
  font-weight: 500;
  border: none;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-primary {
  background: var(--primary);
  color: white;
}

.btn-primary:hover {
  background: #1d4ed8;
}

.btn-secondary {
  background: var(--secondary);
  color: white;
}

.btn-secondary:hover {
  background: #475569;
}

.btn-warning {
  background: var(--warning);
  color: white;
}

.btn-success {
  background: var(--success);
  color: white;
}

.btn-success:hover {
  background: #059669;
}

.btn-danger {
  background: var(--error);
  color: white;
}

.btn-danger:hover {
  background: #dc2626;
}

.btn-outline {
  background: white;
  color: var(--primary);
  border: 1px solid var(--primary);
}

.btn-outline:hover {
  background: var(--primary);
  color: white;
}

.btn-block {
  display: block;
  width: 100%;
  text-align: center;
}

/* Login Page */
.login-page {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  background: linear-gradient(135deg, var(--primary) 0%, #1e40af 100%);
}

.login-container {
  width: 100%;
  max-width: 400px;
  padding: 20px;
}

.login-box {
  background: white;
  padding: 40px;
  border-radius: 12px;
  box-shadow: 0 10px 25px rgba(0,0,0,0.2);
}

.login-box h1 {
  text-align: center;
  color: var(--primary);
  margin-bottom: 10px;
}

.subtitle {
  text-align: center;
  color: var(--secondary);
  margin-bottom: 30px;
}

.form-group {
  margin-bottom: 20px;
}

.form-group label {
  display: block;
  margin-bottom: 5px;
  font-weight: 500;
}

.form-group input {
  width: 100%;
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 14px;
}

.form-group input:focus {
  outline: none;
  border-color: var(--primary);
}

.divider {
  text-align: center;
  margin: 20px 0;
  position: relative;
}

.divider::before {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  width: 100%;
  height: 1px;
  background: var(--border);
}

.divider span {
  background: white;
  padding: 0 10px;
  position: relative;
  color: var(--secondary);
  font-size: 12px;
}

.login-info {
  margin-top: 20px;
  text-align: center;
  font-size: 12px;
  color: var(--secondary);
}

/* Alert */
.alert {
  padding: 10px 14px;
  border-radius: 6px;
  margin-bottom: 15px;
  font-size: 14px;
}

.alert-error {
  background: #fee2e2;
  color: #991b1b;
  border: 1px solid #fecaca;
}

.alert-info {
  background: #dbeafe;
  color: #1e40af;
  border: 1px solid #bfdbfe;
}

/* Stats Grid */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 20px;
  margin: 30px 0;
}

.stat-card {
  background: white;
  padding: 20px;
  border-radius: 8px;
  border: 1px solid var(--border);
}

.stat-card h3 {
  font-size: 14px;
  color: var(--secondary);
  margin-bottom: 10px;
}

.stat-value {
  font-size: 32px;
  font-weight: 700;
  color: var(--primary);
}

.text-error {
  color: var(--error) !important;
}

.text-warning {
  color: var(--warning) !important;
}

.stat-label {
  font-size: 12px;
  color: var(--secondary);
  margin-top: 5px;
}

/* Notifications Grid */
.notifications-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 20px;
  margin: 20px 0;
}

.notification-panel {
  background: white;
  border-radius: 8px;
  border: 1px solid var(--border);
  overflow: hidden;
}

.notification-panel-header {
  background: linear-gradient(135deg, var(--primary) 0%, #1e40af 100%);
  color: white;
  padding: 15px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.notification-panel-header h3 {
  margin: 0;
  font-size: 18px;
  font-weight: 600;
}

.notification-badge-header {
  background: rgba(255, 255, 255, 0.3);
  color: white;
  padding: 4px 10px;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 600;
}

.notification-panel-body {
  padding: 20px;
}

.notification-stats {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.notification-stat {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 15px;
  background: var(--bg);
  border-radius: 6px;
  border: 1px solid var(--border);
}

.notification-stat-label {
  font-size: 14px;
  font-weight: 500;
}

.notification-stat-value {
  font-size: 20px;
  font-weight: 700;
  padding: 4px 12px;
  border-radius: 6px;
}

.notification-stat-value.todo {
  background: #fee2e2;
  color: #991b1b;
}

.notification-stat-value.staging {
  background: #fef3c7;
  color: #92400e;
}

/* Quick Actions */
.quick-actions {
  background: white;
  padding: 20px;
  border-radius: 8px;
  border: 1px solid var(--border);
  margin: 20px 0;
}

.quick-actions h3 {
  margin-bottom: 15px;
}

.quick-actions .btn {
  margin-right: 10px;
  margin-bottom: 10px;
}

/* Info Box */
.info-box {
  background: white;
  padding: 20px;
  border-radius: 8px;
  border: 1px solid var(--border);
  margin: 20px 0;
}

.info-box ul {
  list-style: none;
}

.info-box li {
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
}

.info-box li:last-child {
  border-bottom: none;
}

/* Profile */
.profile-card {
  background: white;
  padding: 30px;
  border-radius: 8px;
  border: 1px solid var(--border);
  max-width: 600px;
}

.profile-header {
  display: flex;
  align-items: center;
  gap: 20px;
  margin-bottom: 30px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--border);
}

.avatar {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: var(--primary);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 32px;
  font-weight: 700;
}

.profile-info dl {
  display: grid;
  grid-template-columns: 150px 1fr;
  gap: 15px;
}

.profile-info dt {
  font-weight: 600;
}

.profile-info dd {
  margin: 0;
}

.text-muted {
  color: var(--secondary);
}

/* Error Page */
.error-page {
  text-align: center;
  padding: 100px 20px;
}

.error-page h1 {
  font-size: 48px;
  color: var(--error);
  margin-bottom: 20px;
}

.error-message {
  font-size: 18px;
  color: var(--secondary);
  margin-bottom: 30px;
}

/* Settings */
.settings-section {
  background: white;
  padding: 15px;
  border-radius: 6px;
  border: 1px solid var(--border);
  margin: 15px 0;
}

.settings-section h3 {
  margin-bottom: 12px;
  font-size: 18px;
}

/* Alert Success */
.alert-success {
  background: #d1fae5;
  color: #065f46;
  border: 1px solid #6ee7b7;
}

/* DB Status Grid */
.db-status-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  margin-top: 10px;
}

.db-status-card {
  background: var(--bg);
  padding: 12px;
  border-radius: 6px;
  border: 1px solid var(--border);
}

.db-status-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 5px;
}

.db-status-card p {
  margin: 0;
  font-size: 13px;
}

.status-badge {
  font-size: 12px;
  padding: 4px 8px;
  border-radius: 4px;
  font-weight: 500;
}

.status-ok {
  background: #d1fae5;
  color: #065f46;
}

.status-error {
  background: #fee2e2;
  color: #991b1b;
}

/* Export Templates */
.export-templates-list {
  margin-top: 10px;
}

.export-template-card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 12px;
  margin-bottom: 12px;
}

.export-template-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.export-template-header > div {
  display: flex;
  align-items: center;
  gap: 10px;
}

.badge {
  font-size: 11px;
  padding: 3px 8px;
  border-radius: 4px;
  font-weight: 500;
}

.badge-active {
  background: var(--success);
  color: white;
}

.badge-inactive {
  background: var(--secondary);
  color: white;
}

.export-template-body {
  margin-bottom: 8px;
}

.export-template-body p {
  margin: 5px 0;
  font-size: 14px;
}

.export-template-body code {
  background: #f1f5f9;
  padding: 2px 6px;
  border-radius: 3px;
  font-family: 'Courier New', monospace;
  font-size: 13px;
}

.export-template-columns {
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid var(--border);
}

.export-template-columns ul {
  list-style: none;
  margin-top: 5px;
}

.export-template-columns li {
  padding: 5px 0;
  font-size: 14px;
}

.export-template-columns code {
  background: #f1f5f9;
  padding: 2px 6px;
  border-radius: 3px;
  font-family: 'Courier New', monospace;
  font-size: 12px;
  color: var(--primary);
}

/* Button small */
.btn-sm {
  padding: 6px 12px;
  font-size: 13px;
}

/* Form small text */
small {
  display: block;
  margin-top: 5px;
  font-size: 12px;
}

/* Form Grid Layout */
.form-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 15px;
}

.form-grid .form-group {
  margin-bottom: 0;
}

/* Form group compact */
.form-group-compact {
  margin-bottom: 12px;
}

/* Panel Controls */
.panel-controls {
  display: flex;
  gap: 8px;
}

/* Collapsible Panel */
.collapsible-panel .panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
  padding: 12px 15px;
  background: #f8fafc;
  border-radius: 6px;
  margin-bottom: 10px;
  transition: background 0.2s;
  user-select: none;
}

.collapsible-panel .panel-header:hover {
  background: #f1f5f9;
}

.collapsible-panel .panel-header-left {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1;
}

.collapsible-panel .panel-header-right {
  display: flex;
  gap: 8px;
}

.collapsible-panel .collapse-icon {
  font-size: 14px;
  color: var(--secondary);
  transition: transform 0.2s;
  user-select: none;
  min-width: 16px;
}

.collapsible-panel .panel-content {
  padding-left: 28px;
}

/* Bulk Actions Toolbar */
.bulk-toolbar {
  background: #fffbeb;
  border: 1px solid #fcd34d;
  border-radius: 6px;
  padding: 12px 15px;
  margin-bottom: 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 15px;
}

.bulk-info {
  font-size: 14px;
  color: var(--text);
}

.bulk-actions {
  display: flex;
  gap: 8px;
}

/* Selected Row Highlight */
.notif-table tbody tr.selected-row {
  background: #eff6ff;
}

/* Pagination (global, removed) */
.pagination {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 30px;
  padding: 15px;
  background: white;
  border-radius: 8px;
  border: 1px solid var(--border);
  gap: 15px;
  flex-wrap: wrap;
}

.pagination-info {
  font-size: 14px;
  color: var(--secondary);
}

.pagination-controls {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}

.pagination-ellipsis {
  padding: 0 8px;
  color: var(--secondary);
}

/* Form Pagination (per-form) */
.form-pagination {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 15px;
  padding: 10px 15px;
  background: var(--bg);
  border-radius: 6px;
  border: 1px solid var(--border);
  gap: 10px;
  flex-wrap: wrap;
  font-size: 13px;
}

.form-pagination .pagination-info {
  font-size: 13px;
}

.form-pagination .pagination-controls {
  gap: 6px;
}

.form-pagination .btn-sm {
  padding: 4px 10px;
  font-size: 12px;
}

.pagination-limit {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
}

.pagination-limit select {
  padding: 6px 10px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 13px;
  cursor: pointer;
}

.pagination-limit select:focus {
  outline: none;
  border-color: var(--primary);
}
