/* ============================================================
   Avetta Contractor Dashboard — Amazon Styled
   ============================================================ */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background: #F9FAFB;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    min-height: 100vh;
    padding: 24px;
}

.container {
    max-width: 900px;
    margin: 0 auto;
}

.card {
    background: #FFFFFF;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}

/* Header */
.header {
    background: #232F3E;
    padding: 20px 32px;
    border-bottom: 3px solid #FF9900;
    display: flex;
    align-items: center;
    gap: 16px;
}

.header-icon {
    width: 44px;
    height: 44px;
    border: 2px solid #FF9900;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
}

.header-text {
    flex: 1;
}

.header-text h1 {
    color: #FFFFFF;
    font-size: 20px;
    font-weight: 700;
    letter-spacing: -0.5px;
}

.header-text p {
    color: #9CA3AF;
    font-size: 13px;
    margin-top: 2px;
}

.btn-settings {
    background: none;
    border: 1px solid #4B5563;
    border-radius: 8px;
    padding: 8px 12px;
    font-size: 16px;
    cursor: pointer;
    transition: border-color 0.2s;
}

.btn-settings:hover {
    border-color: #FF9900;
}

/* Stats Cards */
.stats-row {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    padding: 24px 32px 12px;
}

.stat-card {
    border-radius: 10px;
    padding: 16px 20px;
    border: 1px solid;
}

.stat-blue {
    background: #F0F9FF;
    border-color: #BAE6FD;
}
.stat-blue .stat-label { color: #0369A1; }
.stat-blue .stat-value { color: #0C4A6E; }

.stat-orange {
    background: #FFF7ED;
    border-color: #FED7AA;
}
.stat-orange .stat-label { color: #C2410C; }
.stat-orange .stat-value { color: #7C2D12; }

.stat-green {
    background: #F0FDF4;
    border-color: #BBF7D0;
}
.stat-green .stat-label { color: #15803D; }
.stat-green .stat-value { color: #14532D; }

.stat-red {
    background: #FEF2F2;
    border-color: #FECACA;
}
.stat-red .stat-label { color: #DC2626; }
.stat-red .stat-value { color: #7F1D1D; }

.stat-label {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.stat-value {
    font-size: 28px;
    font-weight: 700;
    margin-top: 4px;
}

/* Filters */
.filters-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 32px;
}

.filters-row input,
.filters-row select {
    padding: 8px 12px;
    border: 1px solid #D1D5DB;
    border-radius: 6px;
    font-size: 13px;
    background: #F9FAFB;
}

.filters-row input {
    flex: 1;
}

.filters-row select {
    width: 140px;
}

.last-updated {
    font-size: 11px;
    color: #9CA3AF;
    white-space: nowrap;
}

/* Table */
.table-container {
    padding: 0 32px 24px;
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
    border: 1px solid #E5E7EB;
    border-radius: 8px;
    overflow: hidden;
}

thead {
    background: #F9FAFB;
}

th {
    padding: 12px 16px;
    font-size: 11px;
    font-weight: 600;
    color: #6B7280;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    text-align: left;
    border-bottom: 2px solid #E5E7EB;
}

th.col-flag, th.col-action, th.col-time {
    text-align: center;
}

td {
    padding: 14px 16px;
    border-bottom: 1px solid #F3F4F6;
    font-size: 14px;
}

tr:hover {
    background: #F9FAFB;
}

.td-flag {
    text-align: center;
}

.flag-dot {
    display: inline-block;
    width: 12px;
    height: 12px;
    border-radius: 50%;
}

.flag-green { background: #10B981; }
.flag-amber { background: #F59E0B; }
.flag-red { background: #EF4444; }

.td-name .name {
    font-weight: 600;
    color: #111827;
}

.td-name .title {
    font-size: 12px;
    color: #6B7280;
    margin-top: 2px;
}

.td-company .company {
    color: #374151;
    font-size: 13px;
}

.td-time {
    text-align: center;
}

.td-time .time {
    font-weight: 500;
    color: #111827;
}

.td-time .duration {
    font-size: 11px;
    color: #9CA3AF;
    margin-top: 2px;
}

.td-action {
    text-align: center;
}

.btn-checkout {
    background: #232F3E;
    color: #FFFFFF;
    border: none;
    border-radius: 6px;
    padding: 8px 14px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}

.btn-checkout:hover {
    background: #FF9900;
    color: #232F3E;
}

.btn-checkout:disabled {
    background: #D1D5DB;
    color: #6B7280;
    cursor: not-allowed;
}

.loading {
    text-align: center;
    color: #6B7280;
    padding: 40px !important;
}

.empty-state {
    text-align: center;
    color: #6B7280;
    padding: 40px !important;
}

/* Footer */
.footer {
    background: #F9FAFB;
    padding: 16px 32px;
    border-top: 1px solid #E5E7EB;
    display: flex;
    justify-content: space-between;
    font-size: 11px;
    color: #9CA3AF;
}

/* Toast */
.toast {
    position: fixed;
    bottom: 24px;
    right: 24px;
    padding: 14px 20px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    transform: translateY(100px);
    opacity: 0;
    transition: transform 0.3s, opacity 0.3s;
    z-index: 1000;
}

.toast.show {
    transform: translateY(0);
    opacity: 1;
}

.toast.success {
    background: #10B981;
    color: white;
}

.toast.error {
    background: #EF4444;
    color: white;
}

/* Setup Screen */
.setup-body {
    padding: 32px;
}

.setup-body label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: #374151;
    margin-bottom: 8px;
}

.setup-body input {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid #D1D5DB;
    border-radius: 6px;
    font-size: 14px;
    margin-bottom: 16px;
}

.setup-body select {
    width: 100%;
    padding: 8px;
    border: 1px solid #D1D5DB;
    border-radius: 6px;
    font-size: 13px;
    margin-bottom: 16px;
}

.btn-primary {
    background: #FF9900;
    color: #232F3E;
    border: none;
    border-radius: 8px;
    padding: 12px 24px;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    width: 100%;
    transition: background 0.2s;
}

.btn-primary:hover {
    background: #E8890A;
}

/* Responsive */
@media (max-width: 768px) {
    body { padding: 12px; }
    .stats-row { grid-template-columns: repeat(2, 1fr); }
    .header { padding: 16px 20px; }
    .stats-row, .filters-row, .table-container, .footer { padding-left: 20px; padding-right: 20px; }
    .stat-value { font-size: 24px; }
    .filters-row { flex-wrap: wrap; }
    .filters-row input { min-width: 100%; }
}
