@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

:root {
    --primary: #7b2ff7;
    --primary-dark: #5a1fd6;
    --primary-light: #a855f7;
    --accent: #e91e63;
    --accent-dark: #c2185b;
    --cyan: #00bcd4;
    --success: #27ae60;
    --warning: #f39c12;
    --danger: #e74c3c;
    --info: #00bcd4;
    --dark: #1a1035;
    --dark-mid: #302b63;
    --dark-end: #24243e;
    --light: #f0ecf9;
    --gray: #95a5a6;
    --white: #ffffff;
    --shadow: 0 2px 10px rgba(123,47,247,0.08);
    --shadow-md: 0 4px 20px rgba(123,47,247,0.12);
    --gradient: linear-gradient(135deg, #7b2ff7, #e91e63);
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background-color: #f8f6ff;
    color: #333;
    line-height: 1.6;
    font-size: 14px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Login Page */
.login-page {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    background: linear-gradient(135deg, var(--primary), var(--dark));
}

.login-container {
    width: 100%;
    max-width: 400px;
    padding: 20px;
}

.login-card {
    background: var(--white);
    border-radius: 10px;
    padding: 40px;
    box-shadow: var(--shadow);
    overflow: visible;
}

.login-header {
    text-align: center;
    margin-bottom: 30px;
}

.login-header h1 {
    color: var(--primary);
    font-size: 2rem;
    margin-bottom: 10px;
}

.login-header p {
    color: var(--gray);
}

.login-footer {
    margin-top: 20px;
    text-align: center;
    font-size: 0.85rem;
    color: var(--gray);
}

/* Navbar */
.navbar {
    background: linear-gradient(135deg, #1a1035 0%, #302b63 50%, #24243e 100%);
    color: var(--white);
    padding: 12px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 4px 20px rgba(0,0,0,0.2);
    flex-wrap: wrap;
    gap: 10px;
}

.nav-brand {
    font-size: 1.3rem;
    font-weight: bold;
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: 10px;
}

.nav-brand img {
    height: 32px;
    width: 32px;
    border-radius: 8px;
}

.nav-links {
    display: flex;
    gap: 5px;
    flex-wrap: wrap;
    justify-content: center;
}

.nav-links a {
    color: var(--light);
    text-decoration: none;
    padding: 8px 12px;
    border-radius: 5px;
    transition: background 0.3s;
    white-space: nowrap;
    font-size: 0.9rem;
}

.nav-links a:hover,
.nav-links a.active {
    background: rgba(255,255,255,0.15);
}

/* Dropdown menu */
.nav-dropdown {
    position: relative;
}

.nav-dropdown > span {
    color: var(--light);
    padding: 8px 12px;
    border-radius: 5px;
    transition: background 0.3s;
    white-space: nowrap;
    font-size: 0.9rem;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    user-select: none;
}

.nav-dropdown > span::after {
    content: '▾';
    font-size: 0.7rem;
    transition: transform 0.2s;
}

.nav-dropdown.open > span::after {
    transform: rotate(180deg);
}

.nav-dropdown > span:hover {
    background: rgba(255,255,255,0.15);
}

.nav-dropdown-content {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    background: #24243e;
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 6px;
    min-width: 180px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.3);
    z-index: 1000;
    padding: 4px 0;
    margin-top: 2px;
}

.nav-dropdown.open .nav-dropdown-content {
    display: block;
}

.nav-dropdown-content a {
    display: block;
    padding: 8px 16px;
    color: var(--light);
    text-decoration: none;
    font-size: 0.85rem;
    transition: background 0.2s;
}

.nav-dropdown-content a:hover {
    background: rgba(123,47,247,0.3);
    color: white;
}

.nav-dropdown-content a.active {
    background: rgba(123,47,247,0.4);
    color: white;
}

.nav-user {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--light);
    font-size: 0.9rem;
}

.nav-user .btn {
    background: var(--accent);
    color: white;
    padding: 5px 12px;
    font-size: 0.8rem;
    border-radius: 15px;
}

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

/* Container */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 40px;
}

/* Page Header */
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 10px;
}

.page-header h1 {
    font-size: 1.5rem;
    color: var(--dark);
    font-weight: 700;
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    font-family: inherit;
    text-decoration: none;
    transition: all 0.3s;
    font-weight: 500;
    text-align: center;
    background: rgba(123,47,247,0.1);
    color: var(--primary);
    line-height: 1.4;
}

.btn:hover {
    transform: translateY(-1px);
    background: rgba(123,47,247,0.18);
}

.btn-primary {
    background: var(--gradient);
    color: var(--white);
}

.btn-primary:hover {
    box-shadow: 0 4px 15px rgba(123,47,247,0.3);
    background: var(--gradient);
}

.btn-success {
    background: var(--success);
    color: var(--white);
}

.btn-success:hover {
    background: #219a52;
}

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

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

.btn-whatsapp {
    background: #25D366;
    color: var(--white);
}

.btn-whatsapp:hover {
    background: #1ebe5b;
    box-shadow: 0 4px 15px rgba(37,211,102,0.35);
}

.btn-small {
    padding: 5px 12px;
    font-size: 0.8rem;
    border-radius: 5px;
}

.btn-outline {
    background: transparent;
    color: var(--primary);
    border: 1px solid var(--primary);
}

.btn-block {
    display: block;
    width: 100%;
}

.row-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: nowrap;
    justify-content: flex-end;
}

/* Cards */
.card {
    background: var(--white);
    border-radius: 10px;
    box-shadow: var(--shadow);
    margin-bottom: 20px;
    overflow: hidden;
    padding: 20px 25px;
}

.card-body {
    padding: 20px 25px;
}

.card-header {
    padding: 15px 20px;
    border-bottom: 1px solid var(--light);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.card-header h2 {
    font-size: 1.1rem;
    color: var(--dark);
    font-weight: 600;
}

/* Grid */
.grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.grid-3 {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 20px;
}

.grid-4 {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 15px;
}

/* Stats */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin-bottom: 20px;
}

.stat-card {
    background: var(--white);
    border-radius: 10px;
    padding: 20px;
    box-shadow: var(--shadow);
    text-align: center;
    border-left: 4px solid var(--primary);
}

.stat-number {
    font-size: 2rem;
    font-weight: 700;
    color: var(--primary);
}

.stat-label {
    font-size: 0.85rem;
    color: var(--gray);
    margin-top: 5px;
}

/* Tables (base - outras paginas) */
.table-container {
    overflow-x: auto;
}

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

.table th {
    background: var(--light);
    padding: 10px 15px;
    text-align: left;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--dark);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.table td {
    padding: 10px 15px;
    border-bottom: 1px solid var(--light);
    font-size: 0.9rem;
}

.table tr:hover {
    background: rgba(123,47,247,0.03);
}

/* ===== Tabela moderna (lista de reparacoes) ===== */
.card-table {
    padding: 0;
}

.card-table-head {
    padding: 16px 20px;
    border-bottom: 1px solid #eef0f6;
}

.table-filter {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
}

.table-search {
    position: relative;
    flex: 1;
    min-width: 220px;
}

.table-search svg {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    width: 16px;
    height: 16px;
    color: #a6adc0;
    pointer-events: none;
}

.table-search input {
    width: 100%;
    padding: 10px 14px 10px 38px;
    border: 1px solid #e6e8f0;
    border-radius: 10px;
    font-size: 0.88rem;
    font-family: inherit;
    background: #fafbfe;
    transition: all .15s ease;
}

.table-search input:focus {
    outline: none;
    border-color: #b79cf0;
    background: #fff;
    box-shadow: 0 0 0 3px rgba(124,58,237,.1);
}

.table-select {
    padding: 10px 14px;
    border: 1px solid #e6e8f0;
    border-radius: 10px;
    font-size: 0.88rem;
    font-family: inherit;
    background: #fafbfe;
    cursor: pointer;
}

.table-select:focus {
    outline: none;
    border-color: #b79cf0;
}

.table-modern {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    min-width: 860px;
}

.table-modern thead th {
    background: #fff;
    padding: 13px 18px;
    text-align: left;
    font-size: 0.68rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #9aa0b4;
    border-bottom: 1px solid #eef0f6;
    white-space: nowrap;
}

.table-modern tbody td {
    padding: 15px 18px;
    border-bottom: 1px solid #f3f4f9;
    vertical-align: middle;
    font-size: 0.86rem;
    color: #2b2f3a;
}

.table-modern tbody tr:last-child td {
    border-bottom: none;
}

.table-modern tbody tr {
    transition: background .15s ease;
}

.table-modern tbody tr:hover {
    background: #faf9ff;
}

.table-modern .c-id {
    color: #a6adc0;
    font-weight: 600;
    font-size: 0.82rem;
    white-space: nowrap;
}

.table-modern .c-tec {
    color: #5b6472;
    white-space: nowrap;
}

.table-modern .c-date {
    white-space: nowrap;
}

.table-modern .c-date-d {
    display: block;
    font-weight: 600;
    color: #2b2f3a;
}

.table-modern .c-date-t {
    display: block;
    font-size: 0.75rem;
    color: #a6adc0;
}

/* Cliente com avatar */
.u-cell {
    display: flex;
    align-items: center;
    gap: 12px;
}

.u-avatar {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex: none;
    font-size: 0.78rem;
    font-weight: 700;
    color: #fff;
    text-transform: uppercase;
    background: linear-gradient(135deg, #8b5cf6, #ec4899);
    box-shadow: 0 4px 10px rgba(139,92,246,.28);
}

.u-info {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.u-name {
    font-weight: 600;
    color: #1e2130;
    line-height: 1.25;
}

.u-sub {
    font-size: 0.75rem;
    color: #a6adc0;
    line-height: 1.3;
}

/* Equipamento */
.eq-name {
    display: block;
    font-weight: 600;
    color: #1e2130;
    white-space: nowrap;
}

.eq-sub {
    display: block;
    font-size: 0.72rem;
    color: #a6adc0;
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    max-width: 170px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Pills de estado */
.pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 11px;
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 600;
    white-space: nowrap;
}

.pill::before {
    content: '';
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: currentColor;
    flex: none;
}

.pill-recebido { background: #fff5e6; color: #b57400; }
.pill-em_analise { background: #e8f1ff; color: #1d6fd6; }
.pill-orcamento_aprovado { background: #e0f2fe; color: #0369a1; }
.pill-em_reparacao { background: #f3e9ff; color: #7c3aed; }
.pill-concluido { background: #e6f8ee; color: #128a4b; }
.pill-entregue { background: #eef1f5; color: #5b6472; }
.pill-cancelado { background: #fdeaea; color: #c0392b; }

.status-form {
    display: block;
    margin-top: 8px;
}

.status-select {
    font-size: 0.72rem;
    padding: 3px 6px;
    border: 1px solid #e6e8f0;
    border-radius: 7px;
    color: #9aa0b4;
    background: #fafbfe;
    cursor: pointer;
}

/* Botoes de acao (icone) */
.icon-btn {
    width: 34px;
    height: 34px;
    border-radius: 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid #eceef5;
    background: #fff;
    color: #6b7280;
    text-decoration: none;
    transition: all .15s ease;
}

.icon-btn svg {
    width: 16px;
    height: 16px;
}

.icon-btn:hover {
    background: #f5f3ff;
    color: #7c3aed;
    border-color: #e3d9fb;
    transform: translateY(-1px);
    box-shadow: 0 4px 10px rgba(124,58,237,.14);
}

.icon-btn.wa:hover {
    background: #eafaf0;
    color: #1da851;
    border-color: #c8f0d8;
    box-shadow: 0 4px 10px rgba(37,211,102,.16);
}

/* Forms */
.form-group {
    margin-bottom: 15px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 500;
    font-size: 0.9rem;
    color: var(--dark);
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 0.9rem;
    font-family: inherit;
    transition: border-color 0.3s;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(123,47,247,0.1);
}

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

.filter-form {
    background: var(--white);
    padding: 15px 20px;
    border-radius: 10px;
    box-shadow: var(--shadow);
    margin-bottom: 20px;
}

.filter-form .form-row {
    display: flex;
    gap: 10px;
    align-items: flex-end;
    flex-wrap: wrap;
}

.filter-form .form-row .form-group {
    margin-bottom: 0;
    flex: 1;
    min-width: 150px;
}

.filter-form .btn {
    height: 44px;
    white-space: nowrap;
}

/* Badges */
.badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.badge-recebido { background: #ff9800; color: white; }
.badge-em_analise { background: #2196f3; color: white; }
.badge-orcamento_aprovado { background: #0891b2; color: white; }
.badge-em_reparacao { background: #9c27b0; color: white; }
.badge-concluido { background: #4caf50; color: white; }
.badge-entregue { background: #607d8b; color: white; }
.badge-cancelado { background: #f44336; color: white; }
.badge-pendente { background: #ff9800; color: white; }

/* Alerts */
.alert {
    padding: 12px 16px;
    border-radius: 8px;
    margin-bottom: 15px;
    font-size: 0.9rem;
}

.alert-success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.alert-danger {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.alert-warning {
    background: #fff3cd;
    color: #856404;
    border: 1px solid #ffeeba;
}

.alert-info {
    background: #d1ecf1;
    color: #0c5460;
    border: 1px solid #bee5eb;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 40px 20px;
    color: var(--gray);
}

.empty-state h3 {
    margin-bottom: 10px;
    color: var(--dark);
}

/* Section Title */
.section-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--dark);
    margin-bottom: 10px;
}

/* Action Links */
.action-link {
    color: var(--primary);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.85rem;
}

.action-link:hover {
    text-decoration: underline;
}

/* Modals */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    z-index: 2000;
    justify-content: center;
    align-items: center;
}

.modal-content {
    background: var(--white);
    border-radius: 10px;
    padding: 24px;
    width: 90%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.modal-header h2 {
    margin: 0;
    font-size: 1.2rem;
    color: var(--dark);
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--gray);
    padding: 0;
    line-height: 1;
}

.modal-close:hover {
    color: var(--danger);
}

.form-actions {
    display: flex;
    gap: 10px;
    margin-top: 20px;
}

.inline-form {
    display: inline;
}

/* Footer */
.footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 30px;
    margin-top: 40px;
    border-top: none;
    color: rgba(255,255,255,0.8);
    font-size: 0.8rem;
    background: linear-gradient(135deg, #1a1035 0%, #302b63 50%, #24243e 100%);
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    box-sizing: border-box;
    z-index: 100;
}

.footer-left, .footer-center, .footer-right {
    flex: 1;
}

.footer-center {
    text-align: center;
}

.footer-right {
    text-align: right;
}

body {
    padding-bottom: 50px;
}

/* Responsive */
@media (max-width: 768px) {
    .grid-2, .grid-3, .grid-4 {
        grid-template-columns: 1fr;
    }
    .form-row {
        grid-template-columns: 1fr;
    }
    .page-header {
        flex-direction: column;
        align-items: flex-start;
    }
}
