/* Sistema Financeiro - CSS Mobile First */

:root {
  --primary-color: #007bff;
  --secondary-color: #6c757d;
  --success-color: #28a745;
  --danger-color: #dc3545;
  --warning-color: #ffc107;
  --info-color: #17a2b8;
  --light-color: #f8f9fa;
  --dark-color: #343a40;
  --white: #ffffff;
  --border-radius: 8px;
  --box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  --transition: all 0.3s ease;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background-color: var(--light-color);
  color: var(--dark-color);
  line-height: 1.6;
  font-size: 16px;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 15px;
}

/* Header */
.header {
  background: var(--primary-color);
  color: var(--white);
  padding: 1rem 0;
  position: sticky;
  top: 0;
  z-index: 1000;
  box-shadow: var(--box-shadow);
}

.header-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.logo {
  font-size: 1.5rem;
  font-weight: bold;
  text-decoration: none;
  color: var(--white);
}

.user-menu {
  position: relative;
}

.user-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

/* Navigation */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--white);
  border-top: 1px solid #e0e0e0;
  display: flex;
  z-index: 1000;
}

.nav-item {
  flex: 1;
  text-align: center;
  padding: 0.5rem;
  text-decoration: none;
  color: var(--secondary-color);
  transition: var(--transition);
}

.nav-item.active,
.nav-item:hover {
  color: var(--primary-color);
  background: rgba(0, 123, 255, 0.1);
}

.nav-item i {
  display: block;
  font-size: 1.5rem;
  margin-bottom: 0.25rem;
}

.nav-item span {
  font-size: 0.75rem;
}

/* Cards */
.card {
  background: var(--white);
  border-radius: var(--border-radius);
  box-shadow: var(--box-shadow);
  margin-bottom: 1rem;
  overflow: hidden;
}

.card-header {
  background: var(--light-color);
  padding: 1rem;
  border-bottom: 1px solid #e0e0e0;
  font-weight: bold;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.card-body {
  padding: 1rem;
}

.card-footer {
  background: var(--light-color);
  padding: 0.75rem 1rem;
  border-top: 1px solid #e0e0e0;
}

/* Buttons */
.btn {
  display: inline-block;
  padding: 0.75rem 1.5rem;
  border: none;
  border-radius: var(--border-radius);
  text-decoration: none;
  text-align: center;
  cursor: pointer;
  transition: var(--transition);
  font-size: 1rem;
  line-height: 1.5;
  min-height: 48px;
}

.btn-primary {
  background: var(--primary-color);
  color: var(--white);
}

.btn-primary:hover {
  background: #0056b3;
}

.btn-success {
  background: var(--success-color);
  color: var(--white);
}

.btn-danger {
  background: var(--danger-color);
  color: var(--white);
}

.btn-outline {
  background: transparent;
  border: 2px solid var(--primary-color);
  color: var(--primary-color);
}

.btn-block {
  display: block;
  width: 100%;
}

.btn-fab {
  position: fixed;
  bottom: 80px;
  right: 20px;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--primary-color);
  color: var(--white);
  border: none;
  font-size: 1.5rem;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
  z-index: 999;
}

/* Forms */
.form-group {
  margin-bottom: 1rem;
}

.form-label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 500;
  color: var(--dark-color);
}

.form-control {
  width: 100%;
  padding: 0.75rem;
  border: 1px solid #ddd;
  border-radius: var(--border-radius);
  font-size: 1rem;
  transition: var(--transition);
}

.form-control:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 2px rgba(0, 123, 255, 0.25);
}

.form-select {
  background-image: url("data:image/svg+xml;charset=utf-8,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3e%3c/svg%3e");
  background-position: right 0.5rem center;
  background-repeat: no-repeat;
  background-size: 1.5rem;
  padding-right: 2.5rem;
}

/* Alerts */
.alert {
  padding: 1rem;
  margin-bottom: 1rem;
  border-radius: var(--border-radius);
  border: 1px solid transparent;
}

.alert-success {
  background: #d4edda;
  border-color: #c3e6cb;
  color: #155724;
}

.alert-danger {
  background: #f8d7da;
  border-color: #f5c6cb;
  color: #721c24;
}

.alert-warning {
  background: #fff3cd;
  border-color: #ffeaa7;
  color: #856404;
}

/* Dashboard */
.dashboard-summary {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.summary-card {
  background: var(--white);
  padding: 1.5rem;
  border-radius: var(--border-radius);
  box-shadow: var(--box-shadow);
  text-align: center;
}

.summary-value {
  font-size: 2rem;
  font-weight: bold;
  margin-bottom: 0.5rem;
}

.summary-label {
  color: var(--secondary-color);
  font-size: 0.9rem;
}

.receita .summary-value {
  color: var(--success-color);
}

.despesa .summary-value {
  color: var(--danger-color);
}

.saldo .summary-value {
  color: var(--primary-color);
}

/* Transaction List */
.transaction-list {
  background: var(--white);
  border-radius: var(--border-radius);
  box-shadow: var(--box-shadow);
}

.transaction-item {
  display: flex;
  align-items: center;
  padding: 1rem;
  border-bottom: 1px solid #f0f0f0;
  text-decoration: none;
  color: inherit;
}

.transaction-item:last-child {
  border-bottom: none;
}

.transaction-icon {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-right: 1rem;
  color: var(--white);
}

.transaction-details {
  flex: 1;
}

.transaction-title {
  font-weight: 500;
  margin-bottom: 0.25rem;
}

.transaction-subtitle {
  font-size: 0.875rem;
  color: var(--secondary-color);
}

.transaction-value {
  font-weight: bold;
  font-size: 1.1rem;
}

.transaction-value.receita {
  color: var(--success-color);
}

.transaction-value.despesa {
  color: var(--danger-color);
}

/* Modals */
.modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  z-index: 1050;
}

.modal.show {
  display: flex;
  align-items: flex-end;
}

.modal-content {
  background: var(--white);
  width: 100%;
  border-radius: var(--border-radius) var(--border-radius) 0 0;
  max-height: 90vh;
  overflow-y: auto;
}

.modal-header {
  padding: 1rem;
  border-bottom: 1px solid #e0e0e0;
  display: flex;
  justify-content: between;
  align-items: center;
}

.modal-title {
  font-size: 1.25rem;
  font-weight: bold;
}

.modal-close {
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: var(--secondary-color);
}

.modal-body {
  padding: 1rem;
}

/* Charts Container */
.chart-container {
  position: relative;
  height: 300px;
  margin: 1rem 0;
}

/* Loading */
.loading {
  text-align: center;
  padding: 2rem;
  color: var(--secondary-color);
}

.spinner {
  border: 3px solid #f3f3f3;
  border-top: 3px solid var(--primary-color);
  border-radius: 50%;
  width: 30px;
  height: 30px;
  animation: spin 1s linear infinite;
  margin: 0 auto 1rem;
}

@keyframes spin {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

/* Content spacing for bottom nav */
.content {
  padding-bottom: 80px;
}

/* Responsive Design */
@media (min-width: 768px) {
  .dashboard-summary {
    grid-template-columns: repeat(3, 1fr);
  }

  .modal.show {
    align-items: center;
  }

  .modal-content {
    max-width: 500px;
    margin: 0 auto;
    border-radius: var(--border-radius);
  }

  .bottom-nav {
    position: static;
    border: none;
    background: var(--primary-color);
    justify-content: center;
  }

  .nav-item {
    color: rgba(255, 255, 255, 0.8);
    max-width: 120px;
  }

  .nav-item.active,
  .nav-item:hover {
    color: var(--white);
    background: rgba(255, 255, 255, 0.1);
  }

  .content {
    padding-bottom: 20px;
  }

  .btn-fab {
    bottom: 20px;
  }
}

/* Utilities */
.text-center {
  text-align: center;
}
.text-left {
  text-align: left;
}
.text-right {
  text-align: right;
}
.mb-1 {
  margin-bottom: 0.5rem;
}
.mb-2 {
  margin-bottom: 1rem;
}
.mb-3 {
  margin-bottom: 1.5rem;
}
.mt-1 {
  margin-top: 0.5rem;
}
.mt-2 {
  margin-top: 1rem;
}
.mt-3 {
  margin-top: 1.5rem;
}
.d-none {
  display: none;
}
.d-flex {
  display: flex;
}
.justify-content-between {
  justify-content: space-between;
}
.align-items-center {
  align-items: center;
}
.flex-1 {
  flex: 1;
}
