/* css/main.css */
:root {
    /* Color Palette */
    --primary: #4f46e5;       /* Indigo */
    --primary-hover: #4338ca;
    --secondary: #10b981;     /* Emerald */
    --secondary-hover: #059669;
    --background: #f8fafc;
    --surface: #ffffff;
    --text-main: #0f172a;
    --text-muted: #64748b;
    --border: #e2e8f0;
    --error: #ef4444;
    --success: #10b981;
    --warning: #f59e0b;
    
    /* Layout */
    --container-width: 1200px;
    --radius-sm: 0.375rem;
    --radius-md: 0.5rem;
    --radius-lg: 1rem;
    
    /* Shadow */
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
}

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

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--background);
    color: var(--text-main);
    line-height: 1.5;
}

/* Typography */
h1, h2, h3, h4 {
    color: var(--text-main);
    font-weight: 600;
}

a {
    text-decoration: none;
    color: var(--primary);
    transition: color 0.2s;
}
a:hover {
    color: var(--primary-hover);
}

/* Layout */
.container {
    max-width: var(--container-width);
    margin: 0 auto;
    padding: 0 1.5rem;
}

/* Navbar */
.navbar {
    background-color: var(--surface);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 50;
    box-shadow: var(--shadow-sm);
}

.navbar-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 4rem;
}

.logo {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--primary);
}

.nav-links {
    display: flex;
    gap: 1.5rem;
    align-items: center;
}

.nav-links a {
    color: var(--text-muted);
    font-weight: 500;
}

.nav-links a.active {
    color: var(--primary);
}

.nav-links a:hover {
    color: var(--text-main);
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.5rem 1rem;
    border-radius: var(--radius-md);
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    border: none;
    font-size: 0.875rem;
}

.btn-primary {
    background-color: var(--primary);
    color: white;
}
.btn-primary:hover {
    background-color: var(--primary-hover);
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.btn-secondary {
    background-color: var(--surface);
    color: var(--text-main);
    border: 1px solid var(--border);
}
.btn-secondary:hover {
    background-color: var(--background);
}

.btn-login {
    background-color: var(--primary);
    color: white !important;
    padding: 0.5rem 1.25rem;
    border-radius: var(--radius-md);
    transition: all 0.2s;
}
.btn-login:hover {
    background-color: var(--primary-hover);
    transform: translateY(-1px);
}

/* Header */
.page-header {
    margin: 2.5rem 0;
    text-align: center;
}

.page-header h2 {
    font-size: 2.25rem;
    margin-bottom: 0.5rem;
    letter-spacing: -0.025em;
}

.page-header p {
    color: var(--text-muted);
    font-size: 1.125rem;
}

/* Cards & Filters */
.filters-card {
    background: var(--surface);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    box-shadow: var(--shadow-md);
    display: flex;
    flex-wrap: wrap;
    gap: 1.5rem;
    margin-bottom: 2rem;
    align-items: flex-end;
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    flex: 1;
    min-width: 200px;
}

.filter-group label {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-main);
}

input, select, textarea {
    padding: 0.625rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    font-family: inherit;
    font-size: 0.875rem;
    transition: border-color 0.2s, box-shadow 0.2s;
    background-color: var(--surface);
}

input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

.filter-actions {
    display: flex;
    gap: 1rem;
}

/* Jobs Grid */
.jobs-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 1.5rem;
}

.job-card {
    background: var(--surface);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    box-shadow: var(--shadow-md);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    border: 1px solid var(--border);
    position: relative;
    overflow: hidden;
}

.job-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.job-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background-color: var(--border);
}

.job-card.status-completado::before { background-color: var(--success); }
.job-card.status-avance::before { background-color: var(--warning); }
.job-card.status-sin-iniciar::before { background-color: var(--error); }

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

.job-title {
    font-size: 1.125rem;
    font-weight: 600;
}

.badge {
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 500;
    text-transform: capitalize;
}

.badge-completado { background: #d1fae5; color: #065f46; }
.badge-avance { background: #fef3c7; color: #92400e; }
.badge-sin-iniciar { background: #fee2e2; color: #991b1b; }

.job-details {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-bottom: 1rem;
    font-size: 0.875rem;
    color: var(--text-muted);
}

.job-costs {
    border-top: 1px solid var(--border);
    padding-top: 1rem;
    display: flex;
    justify-content: space-between;
    font-size: 0.875rem;
}

.cost-item {
    display: flex;
    flex-direction: column;
}
.cost-label {
    font-size: 0.75rem;
    color: var(--text-muted);
}
.cost-value {
    font-weight: 600;
    color: var(--text-main);
}

/* Loading */
.loading {
    text-align: center;
    padding: 3rem;
    color: var(--text-muted);
    font-style: italic;
}

/* Forms (Login/Admin/Tech) */
.form-container {
    max-width: 400px;
    margin: 4rem auto;
    background: var(--surface);
    padding: 2.5rem;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--border);
}

.form-title {
    text-align: center;
    margin-bottom: 2rem;
    font-size: 1.5rem;
}

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

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

.form-group input, .form-group select {
    width: 100%;
}

.btn-full {
    width: 100%;
    padding: 0.75rem;
    font-size: 1rem;
}

/* Error Message */
.alert {
    padding: 1rem;
    border-radius: var(--radius-md);
    margin-bottom: 1rem;
    font-size: 0.875rem;
    display: none;
}
.alert-error {
    background-color: #fef2f2;
    color: #991b1b;
    border: 1px solid #fecaca;
}
.alert-success {
    background-color: #f0fdf4;
    color: #166534;
    border: 1px solid #bbf7d0;
}

/* Utilities */
.hidden { display: none !important; }

/* Admin and Tech Layout */
.dashboard-layout {
    display: flex;
    gap: 2rem;
    margin-top: 2rem;
}
.sidebar {
    width: 250px;
    background: var(--surface);
    padding: 1.5rem;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border);
    align-self: flex-start;
}
.sidebar-menu {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}
.sidebar-menu a {
    display: block;
    padding: 0.75rem 1rem;
    border-radius: var(--radius-md);
    color: var(--text-main);
    font-weight: 500;
}
.sidebar-menu a:hover, .sidebar-menu a.active {
    background: var(--primary);
    color: white;
}
.main-content {
    flex: 1;
}

.section-card {
    background: var(--surface);
    padding: 1.5rem;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border);
    margin-bottom: 2rem;
}

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

.table-container {
    overflow-x: auto;
}
table {
    width: 100%;
    border-collapse: collapse;
}
th, td {
    padding: 1rem;
    text-align: left;
    border-bottom: 1px solid var(--border);
}
th {
    font-weight: 600;
    color: var(--text-muted);
    font-size: 0.875rem;
}
tr:hover {
    background-color: var(--background);
}

.btn-small {
    padding: 0.25rem 0.5rem;
    font-size: 0.75rem;
}

/* Modals */
.modal {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}
.modal.hidden {
    display: none !important;
}
.modal-content {
    background: var(--surface);
    padding: 2rem;
    border-radius: var(--radius-lg);
    width: 90%;
    max-width: 500px;
    box-shadow: var(--shadow-lg);
}
.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}
.close-modal {
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-muted);
}
.close-modal:hover {
    color: var(--error);
}
