/* Reusable Button Components */
:root {
    --brand-color: #439693;
    --brand-color-hover: #3a7f7c;
    --brand-color-light: #6bb3b0;
    --brand-color-dark: #2d6562;
}

* {
    font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";
}

/* Remove underline from links */
a {
    text-decoration: none;
}

/* Remove the margin from the body */
body {
    margin: 0;
}

/* Main Colors */

.brand-color {
    color: var(--brand-color);
}

.bg-brand {
    background-color: var(--brand-color);
}

.border-brand-light {
    border-color: var(--brand-color-light);
}

.bg-brand-light {
    background-color: var(--brand-color-light);
}

.border-brand-dark {
    border-color: var(--brand-color-dark);
}

.bg-brand-dark {
    background-color: var(--brand-color-dark);
}

/* Utility Classes */
.mb-4 {
    margin-bottom: 1rem;
}

.mb-6 {
    margin-bottom: 1.5rem;
}

.mt-4 {
    margin-top: 1rem;
}

.mt-6 {
    margin-top: 1.5rem;
}

/* Background Colors */
.bg-blue-100 {
    background-color: #dbeafe;
}

.bg-green-100 {
    background-color: #dcfce7;
}

.bg-purple-100 {
    background-color: #f3e8ff;
}

.bg-teal-100 {
    background-color: #ccfbf1;
}

/* Text Colors */
.text-blue-600 {
    color: #2563eb;
}

.text-green-600 {
    color: #16a34a;
}

.text-purple-600 {
    color: #9333ea;
}

.text-teal-600 {
    color: #0d9488;
}

/* Button Components */
.cursor-pointer {
    cursor: pointer;
}

.btn-primary {
    display: inline-flex;
    align-items: center;
    padding: 0.5rem 1rem;
    border: 1px solid transparent;
    border-radius: 0.375rem;
    box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    font-size: 0.875rem;
    font-weight: 500;
    color: white;
    background-color: var(--brand-color);
    transition: background-color 0.15s ease-in-out;
    cursor: pointer;
}

.btn-primary:hover {
    background-color: var(--brand-color-hover);
}

.btn-primary:focus {
    outline: none;
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.5);
}

.btn-secondary {
    display: inline-flex;
    align-items: center;
    padding: 0.5rem 1rem;
    border: 1px solid #d1d5db;
    border-radius: 0.375rem;
    box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    font-size: 0.875rem;
    font-weight: 500;
    color: #374151;
    background-color: white;
    transition: background-color 0.15s ease-in-out;
    cursor: pointer;
}

.btn-secondary:hover {
    background-color: #f9fafb;
}

.btn-secondary:focus {
    outline: none;
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.5);
}

.btn-danger {
    display: inline-flex;
    align-items: center;
    padding: 0.5rem 1rem;
    border: 1px solid transparent;
    border-radius: 0.375rem;
    box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    font-size: 0.875rem;
    font-weight: 500;
    color: white;
    background-color: #dc2626;
    transition: background-color 0.15s ease-in-out;
    cursor: pointer;
}

.btn-danger:hover {
    background-color: #b91c1c;
}

.btn-danger:focus {
    outline: none;
    box-shadow: 0 0 0 2px rgba(239, 68, 68, 0.5);
}

.btn-cancel {
    display: inline-flex;
    align-items: center;
    padding: 0.5rem 1rem;
    height: 1rem;
    border: 1px solid #d1d5db;
    border-radius: 0.375rem;
    box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    font-size: 0.875rem;
    font-weight: 500;
    color: #374151;
    background-color: white;
    transition: background-color 0.15s ease-in-out;
    cursor: pointer;
}

.btn-cancel:hover {
    background-color: #f9fafb;
}

.btn-cancel:focus {
    outline: none;
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.5);
}

/* Icons */
.icon-sm {
    width: 1rem;
    height: 1rem;
}

.icon-md {
    width: 1.5rem;
    height: 1.5rem;
}

.icon-with-text {
    width: 1rem;
    height: 1rem;
    margin-right: 0.5rem;
}

/* Form Components */
/* Form Layout */
.form-container > .form-field:not(:last-child) {
    margin-bottom: 1rem;
}

.form-checkbox {
    width: 1rem;
    height: 1rem;
}

.form-field {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.form-field-horizontal {
    display: flex;
    flex-direction: row;
    align-items: flex-end;
    gap: 0;
}

/* Add gap only between form fields that don't have grouped inputs */
.form-field-horizontal > *:not(.form-field) {
    margin-left: 1rem;
}

.form-field-horizontal > .form-field:not(:first-child) {
    margin-left: 0;
}

.form-label {
    font-size: 0.875rem;
    font-weight: 500;
    color: #374151;
    margin-bottom: 0.25rem;
}

.form-input {
    padding: 0.5rem 0.75rem;
    border: 1px solid #d1d5db;
    border-radius: 0.375rem;
    font-size: 0.875rem;
    color: #111827;
    background-color: white;
    transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
    height: 2.5rem;
    box-sizing: border-box;
}

.form-input:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

/* Grouped inputs - remove border radius from middle elements */
.form-field-horizontal .form-field:not(:first-child):not(:last-child) .form-input {
    border-radius: 0;
    border-left: 0;
    margin-left: -1px;
}

.form-field-horizontal .form-field:first-child:not(:only-child) .form-input {
    border-top-right-radius: 0;
    border-bottom-right-radius: 0;
}

.form-field-horizontal .form-field:last-child:not(:only-child) .form-input {
    border-top-left-radius: 0;
    border-bottom-left-radius: 0;
    border-left: 0;
    margin-left: -1px;
}

/* Ensure single form fields keep all rounded borders */
.form-field-horizontal .form-field:only-child .form-input,
.form-field-horizontal .form-field:first-child:last-of-type .form-input {
    border-radius: 0.375rem;
}

/* Special case for when there's a button in the horizontal group */
.form-field-horizontal .form-field:last-child:not(:first-child) .form-input {
    border-left: 0;
    margin-left: -1px;
}

/* Button alignment in horizontal forms */
.form-field-horizontal .btn-primary {
    align-self: flex-end;
    margin-bottom: 0;
    height: fit-content;
}

/* Ensure proper spacing for form fields with buttons */
.form-field-horizontal > .btn-primary {
    margin-left: 0.5rem;
}

.form-help {
    font-size: 0.75rem;
    color: #6b7280;
    margin-top: -0.25rem;
    margin-bottom: 0.25rem;
}

.form-error {
    color: #dc2626;
    font-size: 0.875rem;
    margin-top: 0.25rem;
}

/* Card/Container Components */
.card {
    background-color: white;
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
    overflow: hidden;
    border-radius: 0.5rem;
}

.cards-container > .card + .card {
    margin-top: 1rem;
}

.card-header {
    padding: 1.25rem 1rem;
    border-bottom: 1px solid #e5e7eb;
}

@media (min-width: 640px) {
    .card-header {
        padding: 1.25rem 1.5rem;
    }
}

.card-header-with-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.25rem 1rem;
    border-bottom: 1px solid #e5e7eb;
}

@media (min-width: 640px) {
    .card-header-with-actions {
        padding: 1.25rem 1.5rem;
    }
}

.card-container {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.card-content {
    padding: 1rem 1.5rem;
}

.card-footer-actions {
    padding: 1rem 1.5rem;
    display: flex;
    justify-content: flex-end;
}

/* Chip Component */
.chip {
    display: inline-flex;
    align-items: center;
    padding: 0.125rem 0.625rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 500;
}

.chip-present {
    background-color: #f0fdf4;
    color: #166534;
}

.chip-absent {
    background-color: #fef2f2;
    color: #991b1b;
}

.chip-excused {
    background-color: #fffbeb;
    color: #92400e;
}

.chip-cancelled {
    background-color: #f9fafb;
    color: #374151;
}

.chip-vacation {
    background-color: #faf5ff;
    color: #7c3aed;
}

.chip-csv {
    background-color: #f9fafb;
    color: #374151;
}

.chip-office {
    background-color: #f9fafb;
    color: #37513c;
}

/* Page Layout */

.page-container {
    flex: 1;
    padding: 1.5rem;
    overflow-y: auto;
}

.page-title {
    font-size: 1.875rem;
    font-weight: 700;
    color: #1f2937;
    margin-bottom: 1.5rem;
}

.section-title {
    font-size: 1.125rem;
    line-height: 1.5rem;
    font-weight: 500;
    color: #111827;
}

.section-description {
    margin-top: 0.25rem;
    max-width: 42rem;
    font-size: 0.875rem;
    color: #6b7280;
}

/* Table Components */
.table-title {
    font-size: 0.875rem;
    font-weight: 500;
    color: #111827;
    padding: 0.5rem 1rem;
    background-color: #f9fafb;
}

.table-container {
    min-width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    overflow-x: auto;
    overflow-y: auto;
}

.table-container-horizontal-scroll {
    overflow-x: auto;
    display: block;
}

.table-container thead tr th {
    border-bottom: 1px solid #e5e7eb;
}

.table-container tbody tr td {
    border-bottom: 1px solid #e5e7eb;
}

.table-header {
    background-color: #f9fafb;
}

.table-header-cell {
    padding: 0.75rem 1.5rem;
    text-align: left;
    font-size: 0.75rem;
    font-weight: 500;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.table-header-cell-center {
    padding: 0.75rem 1.5rem;
    text-align: center;
    font-size: 0.75rem;
    font-weight: 500;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.table-body {
    background-color: white;
}

.table-body tr td {
    border-bottom: 1px solid #e5e7eb;
}

.table-cell {
    padding: 1rem 1.5rem;
    white-space: nowrap;
    font-size: 0.875rem;
    color: #6b7280;
}

.table-cell-primary {
    padding: 1rem 1.5rem;
    white-space: nowrap;
    font-size: 0.875rem;
    font-weight: 500;
    color: #111827;
}