/* GT Smart — Shared Styles */

/* ============================================================
   CSS VARIABLES — fonte única de verdade para cores e espaços.
   Para mudar a cor primária do sistema: edite APENAS este bloco.
   ============================================================ */
:root {
    /* Marca GT Smart */
    --gt-primary:       #667eea;   /* roxo/indigo — páginas internas */
    --gt-primary-dark:  #764ba2;   /* roxo escuro — gradiente botão */
    --gt-accent:        #FFa000;   /* dourado — destaque/hover */

    /* Estado */
    --gt-danger:        #dc3545;
    --gt-success:       #28a745;
    --gt-warning:       #ffc107;
    --gt-info:          #0277bd;

    /* Neutros */
    --gt-border:        #e0e0e0;
    --gt-bg-subtle:     #f5f5f5;
    --gt-text-muted:    #666666;
    --gt-text-light:    #888888;

    /* Tamanhos */
    --gt-radius:        8px;
    --gt-radius-lg:     12px;
    --gt-touch:         44px;      /* mínimo touch target */
    --gt-transition:    0.2s ease;
}

/* Reset */
* { margin: 0; padding: 0; box-sizing: border-box; }
body { font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif; min-height: 100vh; padding: 15px; }

/* Layout */
.container { max-width: 1200px; margin: 5px auto; border-radius: 12px; box-shadow: 0 20px 60px rgba(0,0,0,0.3); overflow: hidden; }
.header { color: white; padding: 12px 20px; display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 8px; }
.header h2 { font-size: 18px; font-weight: 800; }
.header-right { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.content { padding: 12px 15px; }
.version { font-size: 10px; opacity: 0.5; text-align: right; padding: 4px 20px 8px; }
.loading { text-align: center; padding: 40px; color: #999; font-size: 14px; }

/* Buttons — all min 44px touch target */
.btn-back { background: rgba(255,255,255,0.2); color: white; border: 2px solid white; padding: 10px 16px; border-radius: 6px; cursor: pointer; font-weight: 600; font-size: 13px; text-decoration: none; transition: opacity 0.2s; min-height: 44px; display: inline-flex; align-items: center; }
.btn-back:hover { opacity: 0.85; }
.btn-link { background: rgba(255,255,255,0.15); color: white; border: 1px solid rgba(255,255,255,0.4); padding: 10px 14px; border-radius: 6px; font-weight: 600; font-size: 12px; text-decoration: none; transition: all 0.2s; min-height: 44px; display: inline-flex; align-items: center; }
.btn-link:hover { background: rgba(255,255,255,0.3); }
.btn-primary { background: linear-gradient(135deg, var(--gt-primary), var(--gt-primary-dark)); color: white; border: none; padding: 12px 20px; border-radius: var(--gt-radius); font-weight: 700; font-size: 14px; cursor: pointer; transition: opacity var(--gt-transition); min-height: var(--gt-touch); }
.btn-primary:hover { opacity: 0.9; }
.btn-primary:disabled { opacity: 0.6; cursor: not-allowed; }
.btn-danger { background: var(--gt-danger); color: white; border: none; padding: 12px 16px; border-radius: 6px; font-weight: 600; cursor: pointer; min-height: var(--gt-touch); }
.btn-success { background: var(--gt-success); color: white; border: none; padding: 12px 16px; border-radius: 6px; font-weight: 600; cursor: pointer; min-height: var(--gt-touch); }

/* Dashboard Grid */
.dashboard-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 10px; margin-bottom: 15px; }

/* Cards */
.card { background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%); padding: 12px; border-radius: var(--gt-radius); border-left: 3px solid var(--gt-primary); }
.card.warning { background: linear-gradient(135deg, #fff3cd 0%, #ffeaa7 100%); border-left-color: var(--gt-warning); }
.card.danger { background: linear-gradient(135deg, #f8d7da 0%, #ff7675 100%); border-left-color: var(--gt-danger); }
.card.success { background: linear-gradient(135deg, #d4edda 0%, #a8e6cf 100%); border-left-color: var(--gt-success); }
.card-label { font-size: 10px; color: #666; text-transform: uppercase; font-weight: 600; margin-bottom: 3px; }
.card-value { font-size: 18px; font-weight: 700; }
.card-sub { font-size: 11px; color: #888; margin-top: 2px; }

/* Status Badges */
.status-badge { display: inline-block; padding: 2px 8px; border-radius: 10px; font-size: 11px; font-weight: 700; }
.status-active { background: #d4edda; color: #155724; }
.status-late { background: #f8d7da; color: #721c24; }
.status-finished { background: #d1ecf1; color: #0c5460; }
.status-archived { background: #e2e3e5; color: #383d41; }
.status-pending { background: #fff3cd; color: #856404; }

/* Tabs */
.tabs { display: flex; border-bottom: 2px solid #e0e0e0; margin-bottom: 15px; overflow-x: auto; }
.tab { padding: 10px 16px; cursor: pointer; font-weight: 600; font-size: 13px; color: #888; border-bottom: 2px solid transparent; margin-bottom: -2px; white-space: nowrap; transition: all 0.2s; }
.tab.active { color: var(--gt-primary); border-bottom-color: var(--gt-primary); }
.tab:hover { color: #333; }

/* Progress Bars */
.progress-bar { height: 8px; background: #e0e0e0; border-radius: 4px; overflow: hidden; }
.progress-fill { height: 100%; border-radius: 4px; transition: width 0.3s; }

/* Forms — mobile friendly inputs (min 44px height) */
.form-group { margin-bottom: 12px; }
.form-group label { display: block; font-size: 13px; font-weight: 600; color: #555; margin-bottom: 4px; }
.form-group input, .form-group select, .form-group textarea { width: 100%; padding: 10px 12px; border: 2px solid #e0e0e0; border-radius: 6px; font-size: 16px; font-family: inherit; transition: border-color 0.2s; min-height: 44px; }
.form-group input:focus, .form-group select:focus, .form-group textarea:focus { outline: none; border-color: var(--gt-primary); }

/* Item Grid (loans, debts, cards) */
.item-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 12px; }

/* Loan/Debt/Card Items */
.loan-item { border: 2px solid #e0e0e0; border-radius: 10px; padding: 12px; transition: all 0.2s; cursor: pointer; }
.loan-item:hover { transform: translateY(-2px); box-shadow: 0 4px 15px rgba(0,0,0,0.1); border-color: var(--gt-primary); }

/* Floating Menu Button — min 44px touch target */
.floating-menu { position: fixed; bottom: 20px; right: 20px; padding: 12px 20px; border-radius: 25px; text-decoration: none; font-weight: 700; font-size: 14px; box-shadow: 0 4px 15px rgba(0,0,0,0.3); z-index: 999; color: white; min-height: 44px; min-width: 44px; display: inline-flex; align-items: center; -webkit-tap-highlight-color: transparent; touch-action: manipulation; }

/* Tables */
.tbl { width: 100%; border-collapse: collapse; font-size: 13px; }
.tbl th { background: #f5f5f5; padding: 8px 10px; text-align: left; font-size: 11px; font-weight: 800; color: #666; text-transform: uppercase; }
.tbl td { padding: 9px 10px; border-bottom: 1px solid #f0f0f0; }
.tbl tr:last-child td { border-bottom: none; }
.tbl tr:hover td { background: #f9f9f9; }

/* Utilities */
.text-center { text-align: center; }
.text-right { text-align: right; }
.mt-8 { margin-top: 8px; }
.mt-12 { margin-top: 12px; }
.mb-12 { margin-bottom: 12px; }
.mb-16 { margin-bottom: 16px; }
.gap-8 { gap: 8px; }
.gap-12 { gap: 12px; }
.flex { display: flex; }
.flex-between { display: flex; justify-content: space-between; align-items: center; }
.hidden { display: none; }

/* Section Title */
.section-title { font-size: 12px; font-weight: 800; color: #555; text-transform: uppercase; letter-spacing: 0.5px; margin: 20px 0 10px; padding-bottom: 6px; border-bottom: 2px solid #e0e0e0; }

/* Accessibility: Skip Nav */
.skip-nav { position: absolute; left: -9999px; top: auto; width: 1px; height: 1px; overflow: hidden; z-index: 10000; }
.skip-nav:focus { position: fixed; top: 10px; left: 10px; width: auto; height: auto; padding: 10px 20px; background: var(--gt-primary); color: white; border-radius: 6px; font-weight: 700; text-decoration: none; box-shadow: 0 4px 15px rgba(0,0,0,0.3); }

/* Print */
@media print { .no-print { display: none !important; } }

/* Mobile: Global touch improvements */
button, a, [onclick], [role="button"] { -webkit-tap-highlight-color: transparent; touch-action: manipulation; }

/* Tablet (768px) */
@media (max-width: 768px) {
    body { padding: 8px; }
    .header { padding: 10px 12px; }
    .header h2 { font-size: 15px; }
    .content { padding: 10px 12px; }
    .dashboard-grid { grid-template-columns: repeat(2, 1fr); }
    .item-grid { grid-template-columns: 1fr; }
    .tbl { font-size: 12px; }
    .tbl th, .tbl td { padding: 7px 8px; }
}

/* Phone (480px) */
@media (max-width: 480px) {
    body { padding: 5px; }
    .header { padding: 8px 10px; flex-direction: column; align-items: flex-start; }
    .header h2 { font-size: 14px; }
    .header-right { width: 100%; justify-content: flex-end; }
    .content { padding: 8px 10px; }
    .dashboard-grid { grid-template-columns: 1fr; }
    .item-grid { grid-template-columns: 1fr; }
    .card-value { font-size: 16px; }
    .section-title { font-size: 11px; }
    .tabs { gap: 0; }
    .tab { padding: 10px 12px; font-size: 12px; }
    .floating-menu { bottom: 12px; right: 12px; padding: 10px 16px; font-size: 13px; }
    .tbl { font-size: 11px; }
    .tbl th, .tbl td { padding: 6px; }
}

/* Small phone (360px) */
@media (max-width: 360px) {
    .header h2 { font-size: 13px; }
    .btn-back, .btn-link { padding: 8px 10px; font-size: 11px; }
    .card { padding: 10px; }
    .card-value { font-size: 15px; }
    .floating-menu { padding: 8px 14px; font-size: 12px; bottom: 8px; right: 8px; }
}
