/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary: #2C3E50;
    --secondary: #34495E;
    --accent: #3498DB;
    --background: #F8F9FA;
    --text: #2C3E50;
    --white: #FFFFFF;
    --gray-100: #F8F9FA;
    --gray-200: #E9ECEF;
    --gray-300: #DEE2E6;
    --sidebar-width: 250px;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #1e3c72 0%, #2a5298 100%);
    min-height: 100vh;
    padding: 15px;
}

/* Layout */
.wrapper {
    display: flex;
    min-height: 100vh;
}


.sidebar.closed {
    transform: translateX(-200px);
}

/* Main Content */
.main-content {
    flex: 1;
    margin-top: 60px;
    padding: 2rem;
    transition: margin 0.3s ease;
    background: #ffffff;
    min-height: calc(100vh - 60px);
}

.main-content.expanded {
    margin-left: 0;
}

/* Container */
.container {
    max-width: 1400px;
    margin: 0 auto;
    background: rgba(255, 255, 255, 0.98);
    border-radius: 25px;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.15);
    backdrop-filter: blur(15px);
    overflow: hidden;
}

/* Welcome Section */
.welcome-section {
    background: linear-gradient(135deg, #2C3E50, #3498db);
    color: #ffffff;
    padding: 2rem;
    border-radius: 1rem;
    margin-bottom: 2rem;
    text-align: center;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.welcome-title {
    font-size: 2.5rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: #ffffff;
}

.welcome-subtitle {
    font-size: 1.1rem;
    opacity: 0.9;
    color: #ECF0F1;
    font-weight: 400;
}

/* Card Grid */
.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    margin: 2rem 0;
}

.feature-card {
    background: var(--white);
    border-radius: 1rem;
    padding: 2rem;
    text-align: center;
    text-decoration: none;
    color: var(--text);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
}

.feature-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.1);
}

.feature-icon {
    font-size: 2.5rem;
    color: var(--accent);
}

.feature-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--primary);
}

.feature-description {
    color: var(--secondary);
    font-size: 0.95rem;
}

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

.form-label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
}

.form-control {
    width: 100%;
    padding: 0.75rem 1rem;
    font-size: 1rem;
    border: 1px solid var(--gray-300);
    border-radius: 0.5rem;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.form-control:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

/* Buttons */
.btn {
    padding: 14px 28px;
    border: none;
    border-radius: 30px;
    cursor: pointer;
    font-size: 15px;
    font-weight: 700;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: inline-flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    margin: 8px;
    position: relative;
    overflow: hidden;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.2);
}

.btn-primary { background: linear-gradient(135deg, #007bff, #0056b3); color: white; }
.btn-success { background: linear-gradient(135deg, #28a745, #1e7e34); color: white; }
.btn-warning { background: linear-gradient(135deg, #ffc107, #e0a800); color: white; }
.btn-secondary { background: linear-gradient(135deg, #6c757d, #545b62); color: white; }
.btn-danger { background: linear-gradient(135deg, #dc3545, #c82333); color: white; }
.btn-info { background: linear-gradient(135deg, #17a2b8, #138496); color: white; }

/* Tables */
.table-container {
    background: var(--white);
    border-radius: 1rem;
    padding: 1.5rem;
    margin: 2rem 0;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    overflow-x: auto;
    max-width: 100vw;
}

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

.table th,
.table td {
    padding: 1rem;
    text-align: left;
    border-bottom: 1px solid var(--gray-200);
}

.table th {
    font-weight: 600;
    background: var(--gray-100);
}

/* Responsive Design */
@media (max-width: 1200px) {
    .card-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
    }
    
    .sidebar.open {
        transform: translateX(0);
    }
    
    .main-content {
        margin-left: 0;
        padding: 1rem;
    }
    
    .main-content.expanded {
        margin-left: 0;
    }
    
    .card-grid {
        grid-template-columns: 1fr;
    }
    
    .welcome-section {
        padding: 2rem 1rem;
        margin-top: 1rem;
    }
    
    .welcome-title {
        font-size: 2rem;
    }
    
    .table-container {
        margin: 1rem 0;
        padding: 1rem;
    }
}

/* --- Estilo Moderno Extraído de caixa.php --- */
.header {
    background: linear-gradient(135deg, #1e3c72 0%, #2a5298 100%);
    color: white;
    padding: 40px 30px;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.header h1 {
    font-size: 3rem;
    margin-bottom: 15px;
    position: relative;
    z-index: 2;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
}

.header p {
    font-size: 1.2rem;
    opacity: 0.95;
    position: relative;
    z-index: 2;
}

.content {
    padding: 40px 30px;
}

.reading-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 25px;
    margin: 40px 0;
}

.method-card {
    background: white;
    border: 3px solid #e9ecef;
    border-radius: 20px;
    padding: 30px;
    text-align: center;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
}

.method-card:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
    border-color: #007bff;
}

.method-card.active {
    border-color: #28a745;
    background: linear-gradient(135deg, #f8fff9 0%, #e8f5e8 100%);
    transform: translateY(-5px);
    box-shadow: 0 15px 35px rgba(40, 167, 69, 0.2);
}

.method-card i {
    font-size: 3.5rem;
    margin-bottom: 20px;
    color: #007bff;
    transition: all 0.4s;
}

.method-card:hover i {
    transform: scale(1.15) rotate(5deg);
    color: #0056b3;
}

.method-card.active i {
    color: #28a745;
    transform: scale(1.1);
}

.method-card h3 {
    color: #343a40;
    margin-bottom: 12px;
    font-size: 1.3rem;
    font-weight: 700;
}

.method-card p {
    color: #6c757d;
    font-size: 0.95rem;
    line-height: 1.5;
}

.scanner-panel {
    display: none;
    background: white;
    border: 3px solid #007bff;
    border-radius: 20px;
    padding: 30px;
    margin: 25px 0;
    box-shadow: 0 15px 35px rgba(0, 123, 255, 0.15);
}

.scanner-panel.active {
    display: block;
    animation: slideInUp 0.4s ease-out;
}

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

.scanner-panel h3 {
    color: #0056b3;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 1.5rem;
}

#reader {
    border-radius: 15px;
    overflow: hidden;
    margin: 20px 0;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
}

#usb-input, #manual-input {
    width: 100%;
    padding: 18px;
    border: 3px solid #e9ecef;
    border-radius: 12px;
    font-size: 15px;
    font-family: 'Courier New', monospace;
    transition: all 0.3s;
    background: #f8f9fa;
}

#usb-input:focus, #manual-input:focus {
    outline: none;
    border-color: #007bff;
    background: white;
    box-shadow: 0 0 0 4px rgba(0, 123, 255, 0.1);
}

#manual-input {
    min-height: 140px;
    resize: vertical;
}

.status {
    padding: 18px 25px;
    margin: 25px 0;
    border-radius: 12px;
    display: none;
    font-weight: 600;
    animation: statusFadeIn 0.4s ease-out;
    font-size: 1.05rem;
}

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

.status.success {
    background: linear-gradient(135deg, #d4edda, #c3e6cb);
    color: #155724;
    border-left: 5px solid #28a745;
}

.status.error {
    background: linear-gradient(135deg, #f8d7da, #f5c6cb);
    color: #721c24;
    border-left: 5px solid #dc3545;
}

.status.info {
    background: linear-gradient(135deg, #d1ecf1, #bee5eb);
    color: #0c5460;
    border-left: 5px solid #17a2b8;
}

.results-panel {
    background: white;
    border-radius: 20px;
    padding: 35px;
    margin: 25px 0;
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.1);
    display: none;
}

.results-panel.active {
    display: block;
    animation: slideInUp 0.4s ease-out;
}

.results-panel h3 {
    color: #343a40;
    margin-bottom: 25px;
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 1.8rem;
}

.table-wrapper {
    overflow-x: auto;
    border-radius: 15px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
    margin-bottom: 25px;
}

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

th {
    background: linear-gradient(135deg, #007bff, #0056b3);
    color: white;
    padding: 18px 15px;
    text-align: left;
    font-weight: 700;
    font-size: 0.95rem;
    text-transform: uppercase;
    letter-spacing: 0.8px;
}

td {
    padding: 15px;
    border-bottom: 1px solid #e9ecef;
    vertical-align: top;
}

tr:hover {
    background: #f8f9fa;
}

.valor-monetario {
    color: #28a745;
    font-weight: 700;
    font-size: 1.05rem;
}

.codigo-qr {
    font-family: 'Courier New', monospace;
}
/* --- Fim do Estilo Moderno --- */

/* --- Melhorias para Fornecedores e Listagens --- */
.card {
  background: #fff;
  border-radius: 18px;
  box-shadow: 0 4px 24px rgba(44, 62, 80, 0.10);
  padding: 32px 28px;
  margin: 0 auto 32px auto;
  max-width: 700px;
}

.supplier-table {
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 4px 16px rgba(0,0,0,0.06);
  background: #fff !important;
  min-width: 900px;
  width: 100%;
  table-layout: auto;
}

.supplier-table th, .supplier-table td {
  padding: 16px 10px;
  background: #fff !important;
  color: #1b4996;
}

.supplier-table tr:nth-child(even) {
  background: #fff !important;
}

.supplier-table tr {
  background: #fff !important;
}

.supplier-table .empty-message {
  background: #fff !important;
  color: #888;
}

#edit-form, #form-cadastro {
  background: #f9fafd;
  border-radius: 16px;
  box-shadow: 0 4px 24px rgba(0,0,0,0.07);
  padding: 28px 20px;
  margin-top: 32px;
}

#edit-form h2, #form-cadastro h2 {
  font-size: 1.5rem;
  margin-bottom: 18px;
  color: #1e3c72;
}

.form-group input {
  font-size: 1.1rem;
  padding: 10px 12px;
}

.btn {
  font-size: 1.1rem;
  padding: 12px 28px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.07);
}

.top-actions, .bottom-actions {
  margin-bottom: 24px;
  margin-top: 24px;
}

.empty-message {
  color: #888;
  font-size: 1.1rem;
  padding: 24px 0;
}

@media (max-width: 900px) {
  .card, #edit-form, #form-cadastro {
    padding: 16px 6px;
  }
  .supplier-table th, .supplier-table td {
    padding: 8px 4px;
  }
  .form-modal {
    max-width: 98vw !important;
    width: 98vw !important;
  }
  .supplier-table {
    min-width: 700px;
  }
}

/* --- ESTILO MODERNO PARA FORMULÁRIO DE FORNECEDORES --- */
#form-cadastro h2 {
  color: #1b4996;
  margin-bottom: 18px;
  font-size: 1.5rem;
  font-weight: 600;
}
.form-group {
  margin-bottom: 18px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}
.form-group label {
  font-weight: 500;
  color: #1b4996;
  margin-bottom: 6px;
  font-size: 1rem;
}
.form-group input[type="text"],
.form-group input[type="number"],
.form-group input[type="email"] {
  width: 100%;
  padding: 10px 14px;
  border: 1.5px solid #d0d7e2;
  border-radius: 8px;
  font-size: 1rem;
  background: #f8fafc;
  color: #222;
  transition: border 0.2s, box-shadow 0.2s;
  outline: none;
}
.form-group input:focus {
  border: 1.5px solid #1b4996;
  box-shadow: 0 0 0 2px #1b499633;
  background: #fff;
}
.form-actions {
  display: flex;
  gap: 12px;
  margin-top: 10px;
}
.btn {
  padding: 10px 22px;
  border: none;
  border-radius: 7px;
  font-size: 1rem;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.2s, color 0.2s, box-shadow 0.2s;
}
.btn-primary {
  background: #1b4996;
  color: #fff;
  box-shadow: 0 2px 8px rgba(44, 62, 80, 0.08);
}
.btn-primary:hover {
  background: #2957f5;
}
.btn-danger {
  background: #e74c3c;
  color: #fff;
}
.btn-danger:hover {
  background: #c0392b;
}
.btn-secondary {
  background: #f3f4f6;
  color: #1b4996;
  border: 1.5px solid #d0d7e2;
}
.btn-secondary:hover {
  background: #e5e7eb;
}
@media (max-width: 800px) {
  .card {
    padding: 18px 6px;
    max-width: 98vw;
  }
}
/* --- FIM ESTILO MODERNO FORMULÁRIO FORNECEDORES --- */

/* --- OVERLAY E MODAL PARA FORMULÁRIO DE FORNECEDORES --- */
#form-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(30, 41, 59, 0.45);
  backdrop-filter: blur(6px);
  z-index: 1000 !important;
}
.form-modal {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 1100 !important;
  background: #fff;
  border-radius: 18px;
  box-shadow: 0 8px 32px rgba(44, 62, 80, 0.18);
  padding: 36px 32px 28px 32px;
  max-width: 1200px !important;
  width: 98vw !important;
  min-width: 280px;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  animation: modalFadeIn 0.25s;
  max-height: 90vh !important;
  overflow-y: auto !important;
}
@keyframes modalFadeIn {
  from { opacity: 0; transform: translate(-50%, -60%); }
  to   { opacity: 1; transform: translate(-50%, -50%); }
}
#form-cadastro h2 {
  color: #1b4996;
  margin-bottom: 18px;
  font-size: 1.5rem;
  font-weight: 600;
}
@media (max-width: 600px) {
  .form-modal {
    padding: 18px 6px 14px 6px;
    max-width: 98vw;
  }
}
body.modal-open {
  overflow: hidden !important;
}
/* --- FIM OVERLAY E MODAL --- */

/* --- MELHORIA VISUAL E ALINHAMENTO FORMULÁRIO FORNECEDORES --- */
.form-modal form {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.form-group {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  margin-bottom: 0;
}
.form-group label {
  font-weight: 500;
  color: #1b4996;
  margin-bottom: 4px;
  font-size: 1rem;
  text-align: left;
}
.form-group input[type="text"],
.form-group input[type="number"],
.form-group input[type="email"] {
  width: 100%;
  min-width: 0;
  box-sizing: border-box;
  padding: 10px 14px;
  border: 1.5px solid #d0d7e2;
  border-radius: 8px;
  font-size: 1rem;
  background: #f8fafc;
  color: #222;
  transition: border 0.2s, box-shadow 0.2s;
  outline: none;
  margin-bottom: 0;
}
.form-group input:focus {
  border: 1.5px solid #1b4996;
  box-shadow: 0 0 0 2px #1b499633;
  background: #fff;
}
/* --- FIM MELHORIA VISUAL E ALINHAMENTO --- */

/* --- ESTILO MODERNO E ALINHADO PARA FORMULÁRIO DE FORNECEDORES --- */
.form-modal form {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.form-group {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  margin-bottom: 0;
}
.form-group label {
  font-weight: 500;
  color: #1b4996;
  margin-bottom: 4px;
  font-size: 1rem;
  text-align: left;
}
.form-group input[type="text"],
.form-group input[type="number"],
.form-group input[type="email"] {
  width: 100%;
  min-width: 0;
  box-sizing: border-box;
  padding: 10px 14px;
  border: 1.5px solid #d0d7e2;
  border-radius: 8px;
  font-size: 1rem;
  background: #f8fafc;
  color: #222;
  transition: border 0.2s, box-shadow 0.2s;
  outline: none;
  margin-bottom: 0;
}
.form-group input:focus {
  border: 1.5px solid #1b4996;
  box-shadow: 0 0 0 2px #1b499633;
  background: #fff;
}
/* --- FIM ESTILO MODERNO E ALINHADO --- */

/* --- VISUAL MODERNO E ALINHADO PARA FORMULÁRIO MODAL DE FORNECEDORES --- */
.form-modal form {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.form-modal .form-group {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  margin-bottom: 0;
}
.form-modal .form-group label {
  font-weight: 500;
  color: #1b4996;
  margin-bottom: 4px;
  font-size: 1rem;
  text-align: left;
}
.form-modal .form-group input[type="text"],
.form-modal .form-group input[type="number"],
.form-modal .form-group input[type="email"] {
  width: 100%;
  min-width: 0;
  box-sizing: border-box;
  padding: 10px 14px;
  border: 1.5px solid #d0d7e2;
  border-radius: 8px;
  font-size: 1rem;
  background: #f8fafc;
  color: #222;
  transition: border 0.2s, box-shadow 0.2s;
  outline: none;
  margin-bottom: 0;
}
.form-modal .form-group input:focus {
  border: 1.5px solid #1b4996;
  box-shadow: 0 0 0 2px #1b499633;
  background: #fff;
}
/* --- FIM VISUAL MODERNO E ALINHADO --- */

/* Destaque visual para linhas pares da tabela de fornecedores */
.supplier-table {
  background: #fff !important;
}
.supplier-table th {
  background: #fff !important;
  color: #1b4996;
}
.supplier-table td {
  background: #fff !important;
  color: #1b4996;
}
.supplier-table tr:nth-child(even) td {
  background: #f6f8fa !important;
}
.supplier-table tr {
  background: #fff !important;
}
.supplier-table .empty-message {
  background: #fff !important;
  color: #888;
}

/* Modal e tabela mais largas */
.form-modal {
  max-width: 1200px !important;
  width: 98vw !important;
}
.table-container {
  max-width: 100vw;
  width: 100%;
  overflow-x: auto;
}
.supplier-table {
  min-width: 1100px;
  width: 100%;
  table-layout: auto;
}
.supplier-table td img {
  max-width: 120px;
  max-height: 80px;
  border-radius: 6px;
  box-shadow: 0 2px 8px #0001;
  display: block;
  margin: 0 auto;
}
@media (max-width: 1200px) {
  .form-modal {
    max-width: 98vw !important;
    width: 98vw !important;
  }
  .supplier-table {
    min-width: 800px;
  }
}

