/* ============================================
   CIVISGLOBAL - Corporate Styles (Based on https://civisglobal.com)
   ============================================ */

/* CSS Variables - Official color palette */
:root {
    --civis-green: #568f37;
    /* Main corporate green */
    --civis-green-dark: #358835;
    /* Dark green (hover) */
    --civis-green-light: #6ba848;
    /* Light green (variant) */

    --civis-text: #66676d;
    /* Main text color */
    --civis-text-dark: #1a1a1a;
    /* Dark text for headings */
    --civis-heading: #000000;
    /* Heading color */

    --civis-white: #ffffff;
    /* White */
    --civis-bg: #FCFCFC;
    /* Body background */
    --civis-gray: #edeef0;
    /* Light gray for borders */
    --civis-gray-dark: #747a7b;
    /* Dark gray for inputs */

    /* Borders and shadows */
    --border-radius-card: 0px;
    /* The site uses straight corners */
    --border-radius-input: 0px;
}

/* Font import - The site uses Archivo Black and Arial */
@import url('https://fonts.googleapis.com/css2?family=Archivo+Black&family=Roboto:wght@300;400;500;700&display=swap');

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

html,
body {
    height: 100%;
    margin: 0;
}

body {
    font-family: 'Roboto', Arial, sans-serif;
    background-color: var(--civis-bg);
    min-height: 100vh;
    color: var(--civis-text);
    font-size: 15px;
    line-height: 28px;
    display: flex;
    flex-direction: column;
}

.content-wrapper {
    flex: 1;
    display: flex;
    flex-direction: column;
    background-color: #f5f7fa;
}

main {
    flex: 1;
}

.px-custom {
    padding-left: 5rem;
    padding-right: 5rem;
}

/* ============================================
   Headings
   ============================================ */
h1,
h2,
h3,
h4,
.logo-text,
.fancy-title {
    font-family: 'Archivo Black', Arial, sans-serif;
    font-weight: 400;
    color: var(--civis-heading);
}

h1 {
    font-size: 42px;
    line-height: 60px;
}

h2 {
    font-size: 36px;
    line-height: 50px;
}

h3 {
    font-size: 32px;
    line-height: 40px;
}

h4 {
    font-size: 24px;
    line-height: 30px;
    font-weight: 600;
}

/* ============================================
   White header
   ============================================ */
.header-white {
    background: var(--civis-white);
    border-bottom: 1px solid #d0d0d0;
}

/* Initials button (green circle) */
.btn-initials {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background-color: var(--civis-green);
    color: white;
    border: none;
    padding: 0;
    font-weight: 600;
    font-size: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background-color 0.3s ease;
    line-height: 1;
}

.btn-initials:hover {
    background-color: var(--civis-green-dark);
}

/* ============================================
   Stat cards
   ============================================ */
.stat-card {
    background: var(--civis-white);
    border-radius: 16px;
    border: 1px solid #e9eef4;
    padding: 1.25rem;
    min-height: 100px;
}

.stat-number {
    font-family: 'Archivo Black', sans-serif;
    font-size: 42px;
    color: var(--civis-heading);
    line-height: 1.1;
}

.stat-label {
    font-size: 14px;
    color: var(--civis-text);
    line-height: 1.3;
}

.stat-context {
    font-size: 14px;
    line-height: 1.3;
}

/* ============================================
   Drop zone
   ============================================ */
.drop-zone {
  background-color: #eaf4e4;
  border: 2px dashed var(--civis-green);
  border-radius: 16px;
  padding: 3rem 1.5rem;
  text-align: center;
  cursor: pointer;
  transition: all 0.3s ease;
}

.drop-zone:hover {
  background-color: #dcecd4;
}

.drop-zone.dragover {
  background-color: #d0e6c5;
  border-color: var(--civis-green-dark);
}

.drop-zone-title {
  font-weight: 700;
  font-size: 18px;
  color: var(--civis-green-dark);
  margin-bottom: 0.25rem;
}

.drop-zone-subtitle {
  font-size: 14px;
  color: var(--civis-green);
  margin-bottom: 0;
}

.modal-card {
  background: var(--civis-white);
  border-radius: 16px;
  padding: 1.5rem;
}

.btn-cancel-modal {
  background: #dc3545;
  border: none;
  color: white;
  font-weight: 600;
  font-size: 14px;
  padding: 0.5rem 1rem;
  border-radius: 8px;
  cursor: pointer;
  transition: background-color 0.15s ease;
}

.btn-cancel-modal:hover {
  background: #b02a37;
  color: white;
}

/* ============================================
   Budgets section
   ============================================ */
.budgets-card {
    background: var(--civis-white);
    border-radius: 16px;
    border: 1px solid #e9eef4;
    overflow: hidden;
}

.budgets-card thead th {
    font-weight: 600;
    font-size: 13px;
    color: var(--civis-text);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom-color: #e9eef4;
}

.budgets-card .sortable {
    cursor: pointer;
    user-select: none;
}

.budgets-card .sortable:hover {
    color: var(--civis-green);
}

.budgets-card .sortable.active {
    color: var(--civis-green-dark);
}

.btn-sort {
    background: none;
    border: none;
    padding: 0;
    font: inherit;
    color: inherit;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    width: 100%;
}

.budgets-card tbody tr:nth-child(even) td {
    background-color: #f5f7fa;
}

.budgets-card td,
.budgets-card th {
    padding-left: 1.25rem;
    padding-right: 1.25rem;
}

.budgets-card tbody tr {
    cursor: pointer;
    transition: background-color 0.15s ease;
}

.budgets-card tbody tr:hover td {
    background-color: #e8ecf1;
}

/* ============================================
   Login card (clean style, no shadows)
   ============================================ */
.card-civis {
    background: var(--civis-white);
    border: none;
    border-radius: var(--border-radius-card);
    overflow: hidden;
}

/* ============================================
   Forms and Inputs (site style)
   ============================================ */
.form-control,
.form-select {
    font-family: 'Roboto', Arial, sans-serif;
    border-radius: var(--border-radius-input);
    border: 1px solid var(--civis-gray);
    background-color: #f9f9f9;
    padding: 12px 16px;
    font-size: 14px;
    transition: all 0.3s ease;
    color: var(--civis-gray-dark);
    box-shadow: none;
}

.form-control:focus,
.form-select:focus {
    border-color: var(--civis-green);
    background-color: #eeeeee !important;
    box-shadow: none;
    outline: none;
    color: var(--civis-gray-dark);
}

.form-control.is-invalid,
.form-select.is-invalid {
    border-color: #dc3545;
    background-image: none;
}

.form-control.is-invalid:focus,
.form-select.is-invalid:focus {
    box-shadow: none;
}

.invalid-feedback {
    font-size: 12px;
    margin-top: 5px;
    color: #dc3545;
}

.form-label {
    font-weight: 500;
    font-size: 14px;
    margin-bottom: 8px;
    color: var(--civis-text);
}

/* ============================================
   CIVISGLOBAL button style (green border, no fill)
   The site uses "button-stroke" style buttons
   ============================================ */
.btn-civis {
    background-color: transparent;
    border: 2px solid var(--civis-green);
    border-radius: 8px;
    padding: 12px 24px;
    font-weight: 600;
    font-size: 16px;
    transition: all 0.3s ease;
    color: var(--civis-green);
    cursor: pointer;
    font-family: 'Roboto', Arial, sans-serif;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.btn-civis:hover {
    background-color: var(--civis-green);
    border-color: var(--civis-green);
    color: var(--civis-white);
    transform: none;
    box-shadow: none;
}

.btn-civis:active {
    transform: none;
}

/* Filled version (for variants) */
.btn-civis-filled {
    background-color: var(--civis-green);
    border: 2px solid var(--civis-green);
    color: var(--civis-white);
}

.btn-civis-filled:hover {
    background-color: var(--civis-green-dark);
    border-color: var(--civis-green-dark);
}

.btn-civis-sm {
    padding: 8px 16px;
    font-size: 14px;
}

/* ============================================
   Logo and branding
   ============================================ */
.logo-container {
    text-align: center;
    margin-bottom: 30px;
}

.logo {
    max-width: 200px;
    height: auto;
}

/* ============================================
   Alerts (site style)
   ============================================ */
.alert-civis {
    border-radius: 0;
    border-left: 4px solid var(--civis-green);
    background-color: #f9f9f9;
}

.alert-civis-danger {
    border-left-color: #962317;
    background-color: #fae9e8;
    color: #962317;
}

/* ============================================
   Color utilities
   ============================================ */
.text-civis-green {
    color: var(--civis-green);
}

.text-civis-green-dark {
    color: var(--civis-green-dark);
}

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

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

/* ============================================
   Separators (site style)
   ============================================ */
hr.civis-hr {
    border: 0;
    height: 1px;
    background: var(--civis-gray);
    margin: 20px 0;
}

/* ============================================
   Links
   ============================================ */
a {
    color: var(--civis-text-dark);
    text-decoration: none;
    transition: color 0.3s ease;
}

a:hover {
    color: var(--civis-green);
}

/* ============================================
   Login layout
   ============================================ */
.login-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background-color: var(--civis-bg);
}

/* ============================================
   Responsive design
   ============================================ */
@media (max-width: 768px) {
    h1 {
        font-size: 32px;
        line-height: 45px;
    }

    h2 {
        font-size: 27px;
        line-height: 38px;
    }

    h3 {
        font-size: 24px;
        line-height: 30px;
    }

    h4 {
        font-size: 18px;
        line-height: 23px;
    }

    .form-control,
    .form-select {
        padding: 10px 14px;
    }

    .btn-civis {
        padding: 10px 20px;
    }

    .logo {
        max-width: 150px;
    }
}

/* ============================================
   Animations
   ============================================ */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in {
    animation: fadeIn 0.3s ease-in-out;
}

/* ============================================
   Loading states for HTMX
   ============================================ */
.htmx-indicator {
    opacity: 0;
    transition: opacity 500ms ease-in;
}

.htmx-request .htmx-indicator {
    opacity: 1;
}

.htmx-request.htmx-indicator {
    opacity: 1;
}

/* Modal backdrop blur */
body:has(.modal.show) {
    overflow: hidden;
}

.modal-backdrop {
    background-color: rgba(0, 0, 0, 0.35) !important;
}

.modal-backdrop.show {
    backdrop-filter: blur(6px) !important;
    -webkit-backdrop-filter: blur(6px) !important;
    opacity: 1 !important;
}