:root {
  --primary: #667eea;
  --primary-dark: #5568d3;
  --success: #10b981;
  --warning: #f59e0b;
  --danger: #ef4444;
  --dark: #1f2937;
  --gray: #6b7280;
  --light-gray: #f3f4f6;
  --white: #ffffff;
  --shadow: 0 1px 3px rgba(0,0,0,0.1);
  --shadow-lg: 0 10px 25px rgba(0,0,0,0.1);
  --radius: 8px;
}

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

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  background: var(--light-gray);
  color: var(--dark);
  line-height: 1.6;
}

/* Login Page */
.login-page {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  padding: 20px;
}

.login-container {
  width: 100%;
  max-width: 420px;
}

.login-box {
  background: var(--white);
  padding: 40px;
  border-radius: 16px;
  box-shadow: var(--shadow-lg);
}

.login-header {
  text-align: center;
  margin-bottom: 30px;
}

.login-header .icon {
  font-size: 48px;
  margin-bottom: 10px;
}

.login-header h1 {
  font-size: 24px;
  color: var(--dark);
  margin-bottom: 5px;
}

.login-header p {
  color: var(--gray);
  font-size: 14px;
}

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

.input-group label {
  display: block;
  margin-bottom: 8px;
  font-weight: 500;
  color: var(--dark);
  font-size: 14px;
}

.input-group input,
.input-group select {
  width: 100%;
  padding: 12px 16px;
  border: 2px solid #e5e7eb;
  border-radius: var(--radius);
  font-size: 14px;
  transition: all 0.3s;
}

.input-group input:focus,
.input-group select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.btn-login {
  width: 100%;
  padding: 14px;
  background: var(--primary);
  color: var(--white);
  border: none;
  border-radius: var(--radius);
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s;
}

.btn-login:hover {
  background: var(--primary-dark);
  transform: translateY(-1px);
  box-shadow: var(--shadow-lg);
}

.error {
  color: var(--danger);
  font-size: 14px;
  margin-top: 15px;
  text-align: center;
  padding: 10px;
  background: #fee;
  border-radius: var(--radius);
  display: none;
}

.error:not(:empty) {
  display: block;
}

.login-footer {
  text-align: center;
  margin-top: 20px;
  padding-top: 20px;
  border-top: 1px solid #e5e7eb;
}

.login-footer small {
  color: var(--gray);
}

/* Navbar */
.navbar {
  background: var(--white);
  padding: 16px 24px;
  box-shadow: var(--shadow);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 15px;
}

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

.nav-icon {
  font-size: 24px;
}

.navbar h2 {
  font-size: 20px;
  color: var(--dark);
}

.nav-actions {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}

.user-name {
  padding: 8px 12px;
  background: var(--light-gray);
  border-radius: var(--radius);
  font-weight: 500;
  font-size: 14px;
}

.btn-admin,
.btn-back,
.btn-logout {
  padding: 8px 16px;
  border: none;
  border-radius: var(--radius);
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  transition: all 0.3s;
}

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

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

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

.btn-admin:hover,
.btn-back:hover,
.btn-logout:hover {
  opacity: 0.9;
  transform: translateY(-1px);
}

/* Container */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 30px 20px;
}

.page-header {
  margin-bottom: 30px;
}

.page-header h1 {
  font-size: 28px;
  color: var(--dark);
  margin-bottom: 5px;
}

.page-header p {
  color: var(--gray);
  font-size: 14px;
}

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

.stat-card {
  background: var(--white);
  padding: 24px;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  display: flex;
  align-items: center;
  gap: 16px;
  transition: all 0.3s;
}

.stat-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

.stat-icon {
  font-size: 36px;
  width: 60px;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius);
  background: var(--light-gray);
}

.stat-card.afazer .stat-icon {
  background: #e0e7ff;
}

.stat-card.total .stat-icon {
  background: #dbeafe;
}

.stat-card.pending .stat-icon {
  background: #fef3c7;
}

.stat-card.completed .stat-icon {
  background: #d1fae5;
}

.stat-info h3 {
  font-size: 14px;
  color: var(--gray);
  text-transform: uppercase;
  font-weight: 500;
  margin-bottom: 5px;
}

.stat-info p {
  font-size: 32px;
  font-weight: 700;
  color: var(--dark);
}

/* Content Card */
.content-card {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.card-header {
  padding: 20px 24px;
  border-bottom: 1px solid #e5e7eb;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 15px;
}

.card-header h2 {
  font-size: 20px;
  color: var(--dark);
}

.btn-primary {
  padding: 10px 20px;
  background: var(--success);
  color: var(--white);
  border: none;
  border-radius: var(--radius);
  cursor: pointer;
  font-size: 14px;
  font-weight: 600;
  transition: all 0.3s;
}

.btn-primary:hover {
  opacity: 0.9;
  transform: translateY(-1px);
}

/* Search Bar */
.search-bar {
  padding: 20px 24px;
  border-bottom: 1px solid #e5e7eb;
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.search-bar input {
  flex: 1;
  min-width: 200px;
  padding: 10px 14px;
  border: 2px solid #e5e7eb;
  border-radius: var(--radius);
  font-size: 14px;
}

.search-bar select {
  padding: 10px 14px;
  border: 2px solid #e5e7eb;
  border-radius: var(--radius);
  font-size: 14px;
  background: white;
  cursor: pointer;
}

.btn-search,
.btn-clear {
  padding: 10px 16px;
  border: none;
  border-radius: var(--radius);
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  transition: all 0.3s;
}

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

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

.btn-search:hover,
.btn-clear:hover {
  opacity: 0.9;
}

/* Table */
.table-wrapper {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
}

th,
td {
  padding: 16px 24px;
  text-align: left;
  border-bottom: 1px solid #e5e7eb;
}

th {
  background: var(--light-gray);
  font-weight: 600;
  color: var(--dark);
  text-transform: uppercase;
  font-size: 12px;
  letter-spacing: 0.5px;
}

td {
  color: var(--gray);
  font-size: 14px;
}

.empty-state {
  text-align: center;
  padding: 40px !important;
  color: var(--gray);
}

.status-badge {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
}

.status-pendente {
  background: #fef3c7;
  color: #92400e;
}

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

.status-afazer {
  background: #e0e7ff;
  color: #3730a3;
}

.tipo-badge {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 600;
  text-transform: capitalize;
  background: #f3f4f6;
  color: #6b7280;
}

.input-group textarea {
  width: 100%;
  padding: 12px 16px;
  border: 2px solid #e5e7eb;
  border-radius: var(--radius);
  font-size: 14px;
  font-family: inherit;
  resize: vertical;
  transition: all 0.3s;
}

.input-group textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.pagination {
  padding: 20px 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-top: 1px solid #e5e7eb;
}

.btn-page {
  padding: 8px 16px;
  background: var(--primary);
  color: var(--white);
  border: none;
  border-radius: var(--radius);
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  transition: all 0.3s;
}

.btn-page:hover:not(:disabled) {
  background: var(--primary-dark);
}

.btn-page:disabled {
  background: #d1d5db;
  cursor: not-allowed;
}

#pageInfo {
  font-size: 14px;
  color: var(--gray);
  font-weight: 500;
}

.btn-action {
  padding: 6px 12px;
  margin: 0 4px;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-size: 12px;
  font-weight: 500;
  transition: all 0.3s;
}

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

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

.btn-action:hover {
  opacity: 0.8;
  transform: translateY(-1px);
}

/* Modal */
.modal {
  display: none;
  position: fixed;
  z-index: 1000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(4px);
  animation: fadeIn 0.3s;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

.modal-content {
  background: var(--white);
  margin: 5% auto;
  border-radius: 12px;
  width: 90%;
  max-width: 500px;
  animation: slideDown 0.3s;
  box-shadow: var(--shadow-lg);
}

@keyframes slideDown {
  from {
    transform: translateY(-50px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

.modal-header {
  padding: 24px;
  border-bottom: 1px solid #e5e7eb;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.modal-header h2 {
  font-size: 20px;
  color: var(--dark);
}

.close {
  font-size: 28px;
  font-weight: bold;
  color: var(--gray);
  cursor: pointer;
  transition: color 0.3s;
  line-height: 1;
}

.close:hover {
  color: var(--dark);
}

.modal-content form {
  padding: 24px;
}

.btn-submit {
  width: 100%;
  padding: 12px;
  background: var(--primary);
  color: var(--white);
  border: none;
  border-radius: var(--radius);
  cursor: pointer;
  font-size: 16px;
  font-weight: 600;
  transition: all 0.3s;
}

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

/* Responsive */
@media (max-width: 768px) {
  .navbar {
    padding: 12px 16px;
  }

  .nav-brand h2 {
    font-size: 16px;
  }

  .container {
    padding: 20px 15px;
  }

  .page-header h1 {
    font-size: 24px;
  }

  .stats {
    grid-template-columns: 1fr;
  }

  .card-header {
    flex-direction: column;
    align-items: stretch;
  }

  .btn-primary {
    width: 100%;
  }

  .search-bar {
    flex-direction: column;
  }

  .search-bar input {
    width: 100%;
  }

  th,
  td {
    padding: 12px 16px;
    font-size: 13px;
  }

  .modal-content {
    margin: 10% auto;
    width: 95%;
  }

  .stat-info p {
    font-size: 28px;
  }
}

@media (max-width: 480px) {
  .login-box {
    padding: 30px 20px;
  }

  .btn-action {
    padding: 4px 8px;
    font-size: 11px;
  }
}
