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

    :root {
      --primary: #2c5f2d;
      --primary-light: #97c3a0;
      --primary-dark: #1a3a1b;
      --accent: #d4a574;
      --accent-dark: #b8865a;
      --bg: #faf8f5;
      --bg-paper: #ffffff;
      --text: #2a2a2a;
      --text-light: #6a6a6a;
      --border: #e5dfd6;
      --shadow: rgba(44, 95, 45, 0.1);
      --danger: #c85a54;
      --warning: #e8a75c;
      --success: #5a9f5e;
    }

    body {
      font-family: 'Work Sans', sans-serif;
      background: var(--bg);
      color: var(--text);
      line-height: 1.6;
      margin: 0;
      padding: 0;
      overflow-x: hidden;
    }

    .app-container {
      min-height: 100vh;
      display: flex;
      flex-direction: column;
    }

    /* Header */
    .header {
      background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary) 100%);
      color: white;
      padding: 1.5rem 2rem;
      box-shadow: 0 4px 16px var(--shadow);
      position: sticky;
      top: 0;
      z-index: 100;
    }

    .header-content {
      max-width: 1400px;
      margin: 0 auto;
      display: flex;
      justify-content: space-between;
      align-items: center;
      flex-wrap: wrap;
      gap: 1rem;
    }

    .logo {
      display: flex;
      align-items: center;
      gap: 0.75rem;
    }

    .logo-icon {
      font-size: 2rem;
    }

    .logo-text h1 {
      font-family: 'Crimson Pro', serif;
      font-size: 1.75rem;
      font-weight: 700;
      letter-spacing: -0.5px;
    }

    .logo-text p {
      font-size: 0.875rem;
      opacity: 0.9;
      font-weight: 400;
    }

    .user-info {
      display: flex;
      align-items: center;
      gap: 1rem;
      background: rgba(255, 255, 255, 0.15);
      padding: 0.625rem 1.25rem;
      border-radius: 50px;
      backdrop-filter: blur(10px);
    }

    .user-avatar {
      width: 40px;
      height: 40px;
      background: var(--accent);
      border-radius: 50%;
      display: flex;
      align-items: center;
      justify-content: center;
      font-weight: 700;
      font-size: 1.125rem;
    }

    .logout-btn {
      background: rgba(255, 255, 255, 0.2);
      border: none;
      color: white;
      padding: 0.5rem 1rem;
      border-radius: 8px;
      cursor: pointer;
      font-size: 0.875rem;
      font-weight: 500;
      transition: all 0.2s;
    }

    .logout-btn:hover {
      background: rgba(255, 255, 255, 0.3);
    }

    /* Main Layout */
    .main-container {
      max-width: 1400px;
      margin: 0 auto;
      padding: 2rem;
      flex: 1;
      width: 100%;
    }

    /* Desktop Layout with Sidebar */
    .desktop-layout {
      display: flex;
      gap: 2rem;
      max-width: 1400px;
      margin: 0 auto;
      padding: 2rem;
      flex: 1;
      width: 100%;
    }

    .sidebar {
      width: 280px;
      flex-shrink: 0;
      height: fit-content;
      position: sticky;
      top: 100px;
    }

    .sidebar-title {
      font-family: 'Crimson Pro', serif;
      font-size: 1.25rem;
      font-weight: 700;
      color: var(--primary-dark);
      margin-bottom: 1rem;
      padding: 0 0.25rem;
    }

    .main-content {
      flex: 1;
      min-width: 0;
    }

    .nav-item {
      display: flex;
      align-items: center;
      gap: 0.75rem;
      padding: 0.75rem 0.875rem;
      margin-bottom: 0.375rem;
      border-radius: 8px;
      background: none;
      border: none;
      width: 100%;
      text-align: left;
      font-size: 0.9375rem;
      font-weight: 600;
      color: var(--text);
      cursor: pointer;
      transition: all 0.2s;
      font-family: inherit;
    }

    .nav-item:last-child {
      margin-bottom: 0;
    }

    .nav-item:hover {
      background: var(--primary-light);
      color: var(--primary-dark);
    }

    .nav-item.active {
      background: var(--primary);
      color: white;
    }

    .nav-item-icon {
      font-size: 1.25rem;
    }

    .nav-item-badge {
      margin-left: auto;
      background: var(--danger);
      color: white;
      padding: 0.125rem 0.5rem;
      border-radius: 10px;
      font-size: 0.75rem;
      font-weight: 700;
    }

    .nav-item.active .nav-item-badge {
      background: white;
      color: var(--primary);
    }

    /* Auth Screen */
    .auth-container {
      min-height: 100vh;
      display: flex;
      align-items: center;
      justify-content: center;
      background: linear-gradient(135deg, var(--primary-light) 0%, var(--bg) 100%);
      padding: 2rem;
    }

    .auth-card {
      background: var(--bg-paper);
      padding: 3rem;
      border-radius: 24px;
      box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
      max-width: 480px;
      width: 100%;
      border: 1px solid var(--border);
    }

    .auth-header {
      text-align: center;
      margin-bottom: 2.5rem;
    }

    .auth-header .logo-icon {
      font-size: 4rem;
      margin-bottom: 1rem;
    }

    .auth-header h1 {
      font-family: 'Crimson Pro', serif;
      font-size: 2rem;
      color: var(--primary-dark);
      margin-bottom: 0.5rem;
    }

    .auth-header p {
      color: var(--text-light);
      font-size: 1rem;
    }

    .form-group {
      margin-bottom: 1.5rem;
    }

    .form-label {
      display: block;
      margin-bottom: 0.5rem;
      font-weight: 600;
      color: var(--text);
      font-size: 0.9375rem;
    }

    .form-input {
      width: 100%;
      padding: 1rem;
      border: 2px solid var(--border);
      border-radius: 12px;
      font-size: 1rem;
      font-family: inherit;
      transition: all 0.2s;
      background: var(--bg);
    }

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

    .btn-primary {
      width: 100%;
      padding: 1.125rem;
      background: var(--primary);
      color: white;
      border: none;
      border-radius: 12px;
      font-size: 1.0625rem;
      font-weight: 600;
      cursor: pointer;
      transition: all 0.2s;
      font-family: inherit;
    }

    .btn-primary:hover {
      background: var(--primary-dark);
      transform: translateY(-2px);
      box-shadow: 0 8px 24px var(--shadow);
    }

    .btn-primary:disabled {
      opacity: 0.5;
      cursor: not-allowed;
      transform: none;
    }

    .error-message {
      background: #fef2f2;
      border: 1px solid var(--danger);
      color: var(--danger);
      padding: 1rem;
      border-radius: 12px;
      margin-bottom: 1.5rem;
      font-size: 0.9375rem;
    }

    .success-message {
      background: #f0fdf4;
      border: 1px solid var(--success);
      color: var(--success);
      padding: 1rem;
      border-radius: 12px;
      margin-bottom: 1.5rem;
      font-size: 0.9375rem;
    }

    /* Navigation Tabs */
    .nav-tabs {
      display: none; /* Escondido no desktop */
      gap: 0.5rem;
      margin-bottom: 2rem;
      border-bottom: 2px solid var(--border);
      flex-wrap: wrap;
    }

    .nav-tab {
      padding: 1rem 1.5rem;
      background: none;
      border: none;
      border-bottom: 3px solid transparent;
      color: var(--text-light);
      font-size: 1rem;
      font-weight: 600;
      cursor: pointer;
      transition: all 0.2s;
      font-family: inherit;
      display: flex;
      align-items: center;
      gap: 0.5rem;
    }

    .nav-tab:hover {
      color: var(--primary);
      background: rgba(44, 95, 45, 0.05);
    }

    .nav-tab.active {
      color: var(--primary);
      border-bottom-color: var(--primary);
    }

    /* Search and Actions Bar */
    .actions-bar {
      display: flex;
      gap: 1rem;
      margin-bottom: 2rem;
      flex-wrap: wrap;
      align-items: center;
    }

    /* Mobile search bar - escondida no desktop */
    .mobile-search-bar {
      display: none;
    }

    .filters-bar {
      display: flex;
      gap: 1rem;
      margin-bottom: 1.5rem;
      flex-wrap: wrap;
      align-items: center;
    }

    .filter-group {
      display: flex;
      align-items: center;
      gap: 0.5rem;
    }

    .filter-label {
      font-weight: 600;
      color: var(--text);
      font-size: 0.9375rem;
    }

    .filter-select {
      padding: 0.625rem 1rem;
      border: 2px solid var(--border);
      border-radius: 10px;
      font-size: 0.9375rem;
      font-family: inherit;
      background: white;
      cursor: pointer;
      min-width: 180px;
    }

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

    .search-box {
      flex: 1;
      min-width: 300px;
      position: relative;
    }

    .search-icon {
      position: absolute;
      left: 1rem;
      top: 50%;
      transform: translateY(-50%);
      color: var(--text-light);
      font-size: 1.125rem;
    }

    .search-input {
      width: 100%;
      padding: 1rem 1rem 1rem 3rem;
      border: 2px solid var(--border);
      border-radius: 12px;
      font-size: 1rem;
      font-family: inherit;
      background: white;
    }

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

    .btn-action {
      padding: 1rem 1.5rem;
      background: var(--primary);
      color: white;
      border: none;
      border-radius: 12px;
      font-size: 1rem;
      font-weight: 600;
      cursor: pointer;
      transition: all 0.2s;
      display: flex;
      align-items: center;
      gap: 0.5rem;
      font-family: inherit;
      white-space: nowrap;
    }

    .btn-action:hover {
      background: var(--primary-dark);
      transform: translateY(-2px);
      box-shadow: 0 8px 16px var(--shadow);
    }

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

    .btn-secondary:hover {
      background: var(--accent-dark);
    }

    /* Cards Grid */
    .cards-grid {
      display: grid;
      grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
      gap: 0.75rem;
      margin-bottom: 2rem;
    }

    .card {
      background: var(--bg-paper);
      border: 2px solid var(--border);
      border-radius: 10px;
      padding: 0.875rem;
      transition: all 0.3s;
      cursor: pointer;
      position: relative;
      overflow: hidden;
    }

    .card::before {
      content: '';
      position: absolute;
      top: 0;
      left: 0;
      right: 0;
      height: 4px;
      background: var(--primary);
      transform: scaleX(0);
      transition: transform 0.3s;
    }

    .card:hover {
      transform: translateY(-2px);
      box-shadow: 0 8px 20px var(--shadow);
      border-color: var(--primary-light);
    }

    .card:hover::before {
      transform: scaleX(1);
    }

    .card-header {
      display: flex;
      justify-content: space-between;
      align-items: flex-start;
      margin-bottom: 1rem;
    }

    .card-icon {
      font-size: 1.5rem;
      margin-bottom: 0.375rem;
    }

    .card-title {
      font-family: 'Crimson Pro', serif;
      font-size: 1.125rem;
      font-weight: 700;
      color: var(--primary-dark);
      margin-bottom: 0.375rem;
    }

    .card-meta {
      display: flex;
      flex-wrap: wrap;
      gap: 0.5rem;
      margin-top: 0.75rem;
      padding-top: 0.75rem;
      border-top: 1px solid var(--border);
    }

    .meta-item {
      display: flex;
      align-items: center;
      gap: 0.25rem;
      font-size: 0.8125rem;
      color: var(--text-light);
    }

    .badge {
      display: inline-block;
      padding: 0.1875rem 0.5rem;
      border-radius: 12px;
      font-size: 0.75rem;
      font-weight: 600;
    }

    .badge-category {
      background: var(--primary-light);
      color: var(--primary-dark);
    }

    .badge-location {
      background: var(--accent);
      color: white;
    }

    .badge-important {
      background: var(--danger);
      color: white;
    }

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

    /* Modal */
    .modal-overlay {
      position: fixed;
      top: 0;
      left: 0;
      right: 0;
      bottom: 0;
      background: rgba(0, 0, 0, 0.6);
      display: flex;
      align-items: center;
      justify-content: center;
      z-index: 1000;
      padding: 1rem;
      backdrop-filter: blur(4px);
      animation: fadeIn 0.2s;
    }

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

    .modal {
      background: var(--bg-paper);
      border-radius: 20px;
      max-width: 700px;
      width: 100%;
      max-height: 90vh;
      overflow-y: auto;
      box-shadow: 0 24px 64px rgba(0, 0, 0, 0.3);
      animation: slideUp 0.3s;
    }

    @keyframes slideUp {
      from {
        opacity: 0;
        transform: translateY(20px);
      }
      to {
        opacity: 1;
        transform: translateY(0);
      }
    }

    .modal-header {
      padding: 2rem;
      border-bottom: 2px solid var(--border);
      display: flex;
      justify-content: space-between;
      align-items: center;
    }

    .modal-title {
      font-family: 'Crimson Pro', serif;
      font-size: 1.75rem;
      font-weight: 700;
      color: var(--primary-dark);
    }

    .modal-close {
      background: none;
      border: none;
      font-size: 1.75rem;
      cursor: pointer;
      color: var(--text-light);
      padding: 0.5rem;
      line-height: 1;
      transition: all 0.2s;
    }

    .modal-close:hover {
      color: var(--danger);
      transform: rotate(90deg);
    }

    .modal-body {
      padding: 2rem;
    }

    .form-row {
      display: grid;
      grid-template-columns: 1fr 1fr;
      gap: 1rem;
    }

    .btn-group {
      display: flex;
      gap: 1rem;
      margin-top: 2rem;
    }

    .btn-outline {
      background: white;
      border: 2px solid var(--border);
      color: var(--text);
      padding: 1rem 1.5rem;
      border-radius: 12px;
      font-size: 1rem;
      font-weight: 600;
      cursor: pointer;
      transition: all 0.2s;
      font-family: inherit;
    }

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

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

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

    /* Empty State */
    .empty-state {
      text-align: center;
      padding: 4rem 2rem;
      background: var(--bg-paper);
      border: 2px dashed var(--border);
      border-radius: 20px;
    }

    .empty-state-icon {
      font-size: 4rem;
      margin-bottom: 1rem;
      opacity: 0.5;
    }

    .empty-state h3 {
      font-family: 'Crimson Pro', serif;
      font-size: 1.5rem;
      color: var(--text);
      margin-bottom: 0.5rem;
    }

    .empty-state p {
      color: var(--text-light);
      margin-bottom: 1.5rem;
    }

    /* Loading */
    .loading {
      display: flex;
      justify-content: center;
      align-items: center;
      padding: 4rem;
    }

    .spinner {
      width: 50px;
      height: 50px;
      border: 4px solid var(--border);
      border-top-color: var(--primary);
      border-radius: 50%;
      animation: spin 0.8s linear infinite;
    }

    @keyframes spin {
      to { transform: rotate(360deg); }
    }

    /* Stats Cards */
    .stats-grid {
      margin-bottom: 1.5rem;
    }

    .stats-unified {
      background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
      color: white;
      padding: 1rem 1.25rem;
      border-radius: 10px;
      box-shadow: 0 4px 12px var(--shadow);
    }

    .stats-row-numbers {
      display: flex;
      justify-content: space-around;
      align-items: center;
      margin-bottom: 0.5rem;
      gap: 1rem;
    }

    .stats-row-labels {
      display: flex;
      justify-content: space-around;
      align-items: center;
      gap: 1rem;
    }

    .stat-item {
      flex: 1;
      text-align: center;
    }

    .stat-number {
      font-size: 1.75rem;
      font-weight: 700;
      line-height: 1;
    }

    .stat-text {
      font-size: 0.75rem;
      opacity: 0.9;
      font-weight: 500;
    }

    /* Separador entre stats */
    .stat-divider {
      width: 1px;
      height: 2rem;
      background: rgba(255, 255, 255, 0.3);
      align-self: center;
    }

    .stat-divider-small {
      width: 1px;
      height: 1rem;
      background: rgba(255, 255, 255, 0.3);
      align-self: center;
    }

    /* Responsive */
    @media (max-width: 768px) {
      html, body {
        margin: 0;
        padding: 0;
        overflow-x: hidden;
        height: 100%;
        width: 100%;
      }

      /* Header compacto no mobile */
      .header {
        padding: 0.75rem 1rem;
      }

      .logo-icon {
        font-size: 1.5rem;
      }

      .logo-text h1 {
        font-size: 1.125rem;
      }

      .logo-text p {
        display: none;
      }

      .user-info {
        padding: 0.375rem 0.75rem;
        gap: 0.5rem;
        background: none;
      }

      .user-avatar {
        width: 32px;
        height: 32px;
        font-size: 0.875rem;
      }

      .user-info span {
        display: none; /* Esconder email */
      }

      .logout-btn {
        padding: 0.375rem 0.625rem;
        font-size: 0.75rem;
      }

      /* Stats inline no header - mobile */
      .header-stats {
        display: flex;
        width: 100%;
        justify-content: space-around;
        margin-top: 0.75rem;
        padding-top: 0.75rem;
        border-top: 1px solid rgba(255, 255, 255, 0.2);
      }

      .header-stat-item {
        text-align: center;
      }

      .header-stat-number {
        font-size: 1.25rem;
        font-weight: 700;
        line-height: 1;
        margin-bottom: 0.25rem;
      }

      .header-stat-label {
        font-size: 0.625rem;
        opacity: 0.85;
        text-transform: uppercase;
        letter-spacing: 0.5px;
      }

      /* Esconder stats-grid no mobile */
      .stats-grid {
        display: none;
      }

      /* Mobile search bar sempre visível */
      .mobile-search-bar {
        display: flex !important;
      }

      .app-container {
        display: flex;
        flex-direction: column;
        height: 100vh;
        overflow: hidden;
      }

      .header {
        flex-shrink: 0;
      }

      .desktop-layout {
        flex: 1;
        display: flex;
        flex-direction: column;
        padding: 0;
        overflow: hidden;
      }

      .sidebar {
        display: none; /* Esconder sidebar no mobile */
      }

      .main-content {
        flex: 1;
        padding: 1rem;
        overflow-y: auto;
        overflow-x: hidden;
        padding-bottom: 90px; /* Espaço para o menu fixo (maior para garantir) */
        -webkit-overflow-scrolling: touch; /* Scroll suave no iOS */
      }

      .nav-tabs {
        display: flex; /* Mostrar tabs no mobile */
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        background: white;
        border-top: 2px solid var(--border);
        padding: 0.5rem 0.25rem;
        padding-bottom: calc(0.5rem + env(safe-area-inset-bottom)); /* Respeitar safe area do iPhone */
        gap: 0.25rem;
        box-shadow: 0 -4px 12px var(--shadow);
        z-index: 1000;
        justify-content: space-around;
        margin: 0;
      }

      .nav-tab {
        flex: 1;
        padding: 0.5rem 0.25rem;
        font-size: 0;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 0.125rem;
        min-height: 56px;
      }

      .nav-tab::before {
        content: attr(data-icon);
        font-size: 1.5rem;
      }

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

      .form-row {
        grid-template-columns: 1fr;
      }

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

      .search-box {
        width: 100%;
        min-width: auto;
      }

      .btn-group {
        flex-direction: column;
      }

      .header-content {
        flex-wrap: wrap;
        gap: 0.5rem;
      }

      /* Barra de busca e filtro mobile */
      .mobile-search-bar {
        display: flex !important;
        gap: 0.5rem;
        margin-bottom: 1rem;
      }

      .mobile-search-input {
        flex: 1;
        padding: 0.625rem;
        border: 2px solid var(--border);
        border-radius: 8px;
        font-size: 0.9375rem;
        font-family: inherit;
      }

      .mobile-filter-select {
        min-width: 100px;
        padding: 0.625rem;
        border: 2px solid var(--border);
        border-radius: 8px;
        font-size: 0.9375rem;
        font-family: inherit;
        background: white;
      }
    }

    .file-upload-area {
      border: 2px dashed var(--border);
      border-radius: 12px;
      padding: 2rem;
      text-align: center;
      background: var(--bg);
      transition: all 0.2s;
      cursor: pointer;
    }

    .file-upload-area:hover {
      border-color: var(--primary);
      background: white;
    }

    .file-upload-area.dragover {
      border-color: var(--primary);
      background: rgba(44, 95, 45, 0.05);
    }

    .file-input {
      display: none;
    }

    .file-preview {
      margin-top: 1rem;
      padding: 1rem;
      background: white;
      border: 1px solid var(--border);
      border-radius: 8px;
      display: flex;
      align-items: center;
      justify-content: space-between;
    }

    .category-color-picker {
      display: flex;
      gap: 0.5rem;
      flex-wrap: wrap;
      margin-top: 0.5rem;
    }

    .color-option {
      width: 40px;
      height: 40px;
      border-radius: 8px;
      border: 3px solid transparent;
      cursor: pointer;
      transition: all 0.2s;
    }

    .color-option.selected {
      border-color: var(--primary-dark);
      transform: scale(1.1);
    }

    .icon-picker {
      display: grid;
      grid-template-columns: repeat(6, 1fr);
      gap: 0.5rem;
      margin-top: 0.5rem;
    }

    .icon-option {
      padding: 0.75rem;
      font-size: 1.5rem;
      border: 2px solid var(--border);
      border-radius: 8px;
      cursor: pointer;
      text-align: center;
      transition: all 0.2s;
      background: white;
    }

    .icon-option.selected {
      border-color: var(--primary);
      background: var(--primary-light);
    }

    .icon-option:hover {
      transform: scale(1.1);
    }
