/* Global Body */
body {
    font-family: Arial, sans-serif;
    background-color: #f4f4f4;
    margin: 0;
    padding: 0;
    color: #333;
}

/* Header and Logo */
header {
    background-color: #00843D;
    padding: 15px 20px;
    color: white;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1400px;
    margin: 0 auto;
    gap: 20px;
}

.logo-container {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    gap: 15px;
}

.logo-container img {
    height: 70px;
    width: auto;
    filter: brightness(1.1) drop-shadow(0 2px 4px rgba(0,0,0,0.2));
}

.logo-text {
    color: white;
    font-size: 1.8em;
    font-weight: bold;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.2);
}

nav {
    display: flex;
    gap: 10px;
    align-items: center;
}

nav a {
    color: #fff;
    text-decoration: none;
    padding: 10px 20px;
    border-radius: 6px;
    transition: all 0.3s ease;
    font-weight: 500;
}

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

/* Filter and Add Button Container */
.header-row.filters {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    padding: 0;
    margin-bottom: 0;
    margin-top: 0;
}

/* Logo pill background for logo and text */
.logo-pill {
    display: flex;
    align-items: center;
    gap: 12px;
    background: #00843D;
    border-radius: 40px;
    padding: 8px 28px 8px 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}
.logo-pill img {
    background: transparent;
    height: 54px;
    width: auto;
    margin-right: 0;
    filter: none;
}
.logo-pill .logo-text {
    color: #fff;
    font-size: 2.2em;
    font-weight: 900;
    letter-spacing: 0.04em;
    text-shadow: 0 2px 8px rgba(0,0,0,0.18), 0 1px 0 #005A2E;
    margin-left: 0;
}

/* Make filter input much larger and prominent */
#filter-input {
    flex: 1;
    width: 100%;
    max-width: 900px;
    padding: 22px 32px !important;
    border: 2.5px solid #00843D;
    border-radius: 16px;
    font-size: 1.35rem !important;
    height: 56px !important;
    box-shadow: 0 4px 16px rgba(0,132,61,0.08);
    background: #f9fdfb;
    margin-right: 18px;
}
#filter-input:focus {
    border-color: #005A2E;
    box-shadow: 0 4px 24px rgba(0,132,61,0.18);
    outline: none;
}

.add-new-btn {
    background-color: #00843D;
    color: white;
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 500;
    font-size: 1rem;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s ease;
    text-decoration: none;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.add-new-btn:hover {
    background-color: #006633;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

.add-new-btn i {
    font-size: 1.2em;
}

@media screen and (max-width: 768px) {
    .header-content {
        flex-direction: column;
        text-align: center;
    }

    .logo-container {
        flex-direction: column;
    }

    .logo-container img {
        height: 60px;
    }

    nav {
        flex-direction: column;
        width: 100%;
    }

    nav a {
        width: 100%;
        text-align: center;
    }

    .header-row.filters {
        flex-direction: column;
    }

    .logo-pill {
        padding: 6px 10vw 6px 4vw;
        border-radius: 30px;
    }
    .logo-pill img {
        height: 38px;
    }
    .logo-pill .logo-text {
        font-size: 1.3em;
    }
    #filter-input {
        font-size: 1.1em !important;
        padding: 14px 10px !important;
        height: 44px !important;
        max-width: 98vw;
    }

    .add-new-btn {
        width: 100%;
        justify-content: center;
    }
}

@media screen and (max-width: 900px) {
    #filter-input {
        max-width: 98vw;
    }
}

/* Navigation Bar */
nav {
    display: flex;
    justify-content: center;
    background-color: #006633; /* Darker Green */
    padding: 10px 0;
}

nav a {
    color: #fff;
    text-decoration: none;
    padding: 10px 20px;
    text-align: center;
}

/* Button Container and Buttons */
.button-container {
    text-align: center;
    padding: 20px;
}

/* Button Styles */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: 4px;
    font-size: 0.9rem;
    font-weight: 500;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
    border: none;
}

.btn i {
    font-size: 0.9em;
}

.btn-view {
    background-color: #4CAF50;
    color: white;
}

.btn-view:hover {
    background-color: #45a049;
}

.btn-edit {
    background-color: #2196F3;
    color: white;
}

.btn-edit:hover {
    background-color: #1e88e5;
}

.btn-delete {
    background-color: #f44336;
    color: white;
}

.btn-delete:hover {
    background-color: #e53935;
}

.btn-shura {
    background-color: #9C27B0;
    color: white;
}

.btn-shura:hover {
    background-color: #8e24aa;
}

input[type="radio"]:checked + label {
  background: #007bff;
  color: #fff;
}

/* Tab content: hide all by default */
.tab-content {
  display: none;
}
/* Title styling */
h2 {
    text-align: center;
    font-weight: bold;
    color: #00843D; /* SANZAF Green */
    margin:0px;
    margin-bottom:5px;
}
/* Display the corresponding content when a radio button is checked */
#tab1:checked ~ .content .content-tab1,
#tab2:checked ~ .content .content-tab2,
#tab3:checked ~ .content .content-tab3,
#tab4:checked ~ .content .content-tab4 {
  display: block;
}

/* Input fields: smaller size with green border */
input[type="text"],
input[type="number"],
input[type="tel"],
input[type="date"],
select,
textarea {
  width: 100%;
  padding: 4px; /* smaller padding */
  margin-top: 2px;
  margin-bottom: 6px; /* reduced margin */
  border: 1px solid #00843D; /* green border */
  border-radius: 4px;
  font-size: 12px; /* smaller font size */
}


/* Navigation buttons for the wizard */
.nav-buttons {
  display: flex;
  justify-content: space-between;
  margin-top: 20px;
}
.nav-buttons label.button,
.nav-buttons button {
  padding: 10px 20px;
  border: none;
  border-radius: 4px;
  background: #007bff;
  color: #fff;
  text-align: center;
  cursor: pointer;
  transition: background 0.3s;
  text-decoration: none;
}
.nav-buttons button {
  outline: none;
}
.nav-buttons label.button:hover,
.nav-buttons button:hover {
  background: #0056b3;
}
/* Special styling for the submit button */
.nav-buttons button.submit {
  background: #28a745;
}
.nav-buttons button.submit:hover {
  background: #1e7e34;
}
.flex-row {
  display: flex;
  gap: 20px;
}
.flex-row > .form-section {
  flex: 1;
}
/* Tab Navigation Styles */
.tab-labels {
  display: flex;
  justify-content: space-between;
  margin-bottom: 5px;
  border-bottom: 2px solid #00843D;
}
.tab-labels .tab-link {
  flex: 1;
  padding: 12px;
  text-align: center;
  background: #f4f4f4;
  color: #333;
  cursor: pointer;
  border-radius: 4px 4px 0 0;
  margin-right: 5px;
  transition: background 0.3s, color 0.3s;
}
.tab-labels .tab-link:last-child {
  margin-right: 0;
}
.tab-labels .tab-link.active {
  background: #00843D;
  color: #fff;
  font-weight: bold;
  border-bottom: 4px solid #005A2E;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

input[name="tabs"]:checked + label {
  background: #00843D; /* Active tab SANZAF Green */
  color: #fff;
  font-weight: bold;
  padding: 16px 12px;  /* Increased padding for a taller tab */
  border-bottom: 4px solid #005A2E; /* Darker green indicator */
  box-shadow: 0 4px 6px rgba(0,0,0,0.1); /* Subtle shadow */
}

/* Wizard Tab Content */
.content {
  padding: 20px;
  padding-top:5px;
  border: 1px solid #333;
  border-top: none;
  border-radius: 0 0 4px 4px;
  background-color: #fff;
}
/* Remove extra margin between labels and inputs */
.form-section label {
    display: block;
    margin-bottom: 0; /* Remove extra margin */
    color: #00843D;
    font-weight: normal;
    align-items:center
}

.form-section input[type="text"],
.form-section input[type="number"],
.form-section input[type="tel"],
.form-section input[type="date"],
.form-section textarea,
.form-section select {
    width: 100%;
    padding: 6px; /* Reduced padding for a condensed look */
    margin-top: 2px;
    margin-bottom: 10px; /* You can reduce this further if needed */
    border: 1px solid #333;
    border-radius: 4px;
    font-size: 14px;
}

/* Optional: Adjust vertical spacing within a form section */
.form-section {
    width: 90%;
    margin-bottom: 10px;
}

/* Contact Details two-column layout adjustments */
.contact-columns {
    display: flex;
    gap: 20px;
}
.contact-left, .contact-right {
    flex: 1;
}
.contact-columns .form-section {
    margin-bottom: 8px; /* Tighter spacing in contact columns */
}
/* Optional: Style for top tab navigation if used */
.tab-link {
  display: inline-block;
  padding: 12px;
  margin-right: 5px;
  background: #f4f4f4;
  color: #333;
  cursor: pointer;
  border-radius: 4px 4px 0 0;
  transition: background 0.3s, color 0.3s;
}

.tab-link.active {
  background: #00843D;
  color: #fff;
  font-weight: bold;
  border-bottom: 4px solid #005A2E;
  box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}
.tile-group {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 10px;
}

.tile {
    display: inline-block;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    padding: 14px 22px;
    background: #f9f9f9;
    cursor: pointer;
    transition: all 0.3s ease;
    user-select: none;
    font-size: 1em;
    margin-bottom: 8px;
    position: relative;
    overflow: hidden;
}

.tile:hover {
    border-color: #00843D;
    background: #f0f9f5;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.tile.selected {
    background: #00843D;
    color: white;
    border-color: #00843D;
    box-shadow: 0 2px 8px rgba(0,132,61,0.2);
    transform: translateY(-1px);
}

.tile.selected::after {
    content: '✓';
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 1.2em;
    color: white;
}

.tile:focus {
    outline: none;
    border-color: #00843D;
    box-shadow: 0 0 0 3px rgba(0,132,61,0.2);
}

.finance-grid {
  display: grid;
  grid-template-columns: 1fr 1fr; /* 2 columns */
  /* Remove grid-template-rows so rows auto-size based on content */
  gap: 20px;
  align-items: start; /* ensures boxes align at the top, not stretch */
}

.finance-section {
  border: 1px solid #333;
  padding: 10px;
  border-radius: 4px;
  background-color: #f9f9f9;
  /* Remove any fixed height or min-height */
  /* height: auto; */
}
h3,h4 {
    margin: 5px;
}
/* Example: Mobile / smaller screens (up to 768px wide) */
@media screen and (max-width: 768px) {

  /* Container: remove fixed width, reduce padding, remove heavy borders, etc. */
  .container {
    max-width: 100%;
    margin: 0;
    border: none;
    border-radius: 0;
    box-shadow: none;
    padding: 10px;
  }

  /* Make the .tab-labels wrap so tabs don't get squished */
  .tab-labels {
    display: flex;
    flex-wrap: wrap;
    justify-content: center; /* center them horizontally */
    margin-bottom: 10px;
  }

  /* Each tab link can take up half the width or full width as needed */
  .tab-labels .tab-link {
    flex: 1 1 45%;
    margin: 2px;
  }

  /* If you want each tab on its own line, use flex: 1 1 100%; */

  /* Form sections: stack them vertically instead of side-by-side */
  .flex-row {
    flex-direction: column;
  }
  .flex-row > .form-section {
    flex: none;
    width: 100%;
  }

  /* Contact details columns: stack them */
  .contact-columns {
    display: block;
  }
  .contact-left, .contact-right {
    width: 100%;
  }

  /* Finance grid: switch to single-column so each .finance-section is full-width */
  .finance-grid {
    display: block;
  }
  .finance-section {
    margin-bottom: 15px; /* space between each section */
  }

  /* Tweak form inputs for smaller screens: smaller margins, full width, etc. */
  .form-section input[type="text"],
  .form-section input[type="number"],
  .form-section input[type="tel"],
  .form-section input[type="date"],
  .form-section textarea,
  .form-section select {
    font-size: 14px;
    padding: 6px;
    margin-bottom: 8px;
  }

  /* Adjust the tile-group to wrap in a single column or two columns, etc. */
  .tile-group {
    display: grid;
    grid-template-columns: 1fr 1fr; /* 2 columns on small screens */
    gap: 8px;
  }
  /* For a single-column tile layout: grid-template-columns: 1fr; */

  /* Nav buttons: stack or center them */
  .nav-buttons {
    flex-direction: column;
    align-items: center;
  }
  .nav-buttons button {
    width: 100%;
    margin-bottom: 5px;
  }
}
.hidden {
      display: none;
    }

/* All modal-related styles removed to avoid conflicts with shura_requests.css */

/* Responsive table container */
.table-responsive {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}
.table-responsive table {
    min-width: 1000px;
}

/* Stack action buttons vertically on small screens */
@media (max-width: 1100px) {
  .actions-cell .action-buttons {
    flex-wrap: wrap;
    gap: 4px;
    justify-content: center;
  }
  .actions-cell .btn {
    min-width: 70px;
    font-size: 0.92em;
    padding: 6px 8px;
  }
}

/* Hide less important columns on small screens */
@media (max-width: 900px) {
  .actions-cell, th.col-actions {
    min-width: 120px;
    max-width: 140px;
    font-size: 0.92em;
    white-space: nowrap;
  }
  .actions-cell .btn {
    min-width: 60px;
    font-size: 0.85em;
    padding: 5px 6px;
  }
  .action-buttons {
    flex-direction: column;
    gap: 4px;
    align-items: stretch;
  }
}

@media (max-width: 600px) {
  .actions-cell, th.col-actions {
    min-width: 90px;
    max-width: 100px;
    font-size: 0.8em;
    white-space: nowrap;
  }
  .actions-cell .btn {
    min-width: 48px;
    font-size: 0.78em;
    padding: 4px 4px;
  }
  .action-buttons {
    flex-direction: column;
    gap: 2px;
    align-items: stretch;
  }
}

/* Edit Application Page Styles */
.edit-form {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    padding: 2rem;
    margin: 2rem 0;
}

.edit-form .tab-labels {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
    justify-content: center;
    flex-wrap: wrap;
}

.edit-form .tab-link {
    background: #fff;
    color: var(--primary-color);
    border: 1px solid var(--primary-color);
    border-radius: 8px 8px 0 0;
    padding: 0.75rem 1.5rem;
    cursor: pointer;
    font-weight: 500;
    font-size: 1rem;
    transition: all 0.3s ease;
    margin-right: 0.25rem;
    min-width: 120px;
    text-align: center;
}

.edit-form .tab-link.active {
    background: var(--primary-color);
    color: #fff;
    border-bottom: 2px solid #fff;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.edit-form .tab-content {
    background: #fff;
    border-radius: 0 0 12px 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    padding: 2rem;
    margin-bottom: 2rem;
}

.edit-form .form-section {
    margin-bottom: 1.5rem;
}

.edit-form .form-section label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: #333;
}

.edit-form .form-section input,
.edit-form .form-section select,
.edit-form .form-section textarea {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 1rem;
    background: #f8fcfa;
    transition: all 0.3s ease;
}

.edit-form .form-section input:focus,
.edit-form .form-section select:focus,
.edit-form .form-section textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(0, 132, 61, 0.1);
}

.edit-form .nav-buttons {
    display: flex;
    justify-content: space-between;
    margin-top: 2rem;
    padding-top: 1rem;
    border-top: 1px solid #eee;
}

.edit-form .nav-buttons button {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 8px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
}

.edit-form .nav-buttons .nav-prev {
    background: #f8f9fa;
    color: #333;
}

.edit-form .nav-buttons .nav-next,
.edit-form .nav-buttons .submit {
    background: var(--primary-color);
    color: #fff;
}

.edit-form .nav-buttons button:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.edit-form .nav-buttons .nav-prev:hover {
    background: #e9ecef;
}

.edit-form .nav-buttons .nav-next:hover,
.edit-form .nav-buttons .submit:hover {
    background: #006633;
}

.edit-form .required {
    color: #dc3545;
    margin-left: 0.25rem;
}

.edit-form .error-message {
    background: #fff3cd;
    color: #856404;
    padding: 1rem;
    border-radius: 8px;
    margin-bottom: 1rem;
    border: 1px solid #ffeeba;
}

/* Responsive styles for edit form */
@media (max-width: 768px) {
    .edit-form {
        padding: 1rem;
    }

    .edit-form .tab-labels {
        flex-direction: column;
        gap: 0.5rem;
    }

    .edit-form .tab-link {
        width: 100%;
        border-radius: 8px;
        margin-right: 0;
    }

    .edit-form .tab-content {
        padding: 1rem;
    }

    .edit-form .nav-buttons {
        flex-direction: column;
        gap: 1rem;
    }

    .edit-form .nav-buttons button {
        width: 100%;
    }
}

/* Edit Application Header Styles */
.edit-form .header-info {
    text-align: center;
    margin-bottom: 2rem;
    padding: 1.5rem;
    background: #f9fdfb;
    border-radius: 12px;
    border: 1px solid #e0e4e8;
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}

.edit-form .header-info h1 {
    font-size: 2.2em;
    color: #00843D;
    margin: 0;
    font-weight: 600;
    letter-spacing: 0.02em;
}

.edit-form .header-info .file-number {
    display: inline-block;
    font-size: 1.1em;
    color: #dc3545;
    font-weight: 600;
    margin-top: 0.5rem;
    padding: 0.3rem 1rem;
    background: rgba(220, 53, 69, 0.1);
    border-radius: 6px;
    border: 1px solid rgba(220, 53, 69, 0.2);
}

@media (max-width: 768px) {
    .edit-form .header-info {
        padding: 1rem;
        margin-bottom: 1.5rem;
    }
    
    .edit-form .header-info h1 {
        font-size: 1.8em;
    }
    
    .edit-form .header-info .file-number {
        font-size: 1em;
    }
}

/* View Page Assistance Items */
.assistance-items {
    margin: 1rem 0;
    padding: 1rem;
    background: #f9fdfb;
    border-radius: 8px;
    border: 1px solid #e0e4e8;
}

.assistance-items h3 {
    color: #00843D;
    font-size: 1.1em;
    margin-bottom: 1rem;
    font-weight: 600;
}

.assistance-tiles {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.view-tile {
    display: inline-block;
    padding: 0.5rem 1rem;
    background: #00843D;
    color: white;
    border-radius: 6px;
    font-size: 0.9em;
    font-weight: 500;
}

.financial-details {
    margin-top: 1.5rem;
    padding-top: 1rem;
    border-top: 1px solid #e0e4e8;
}

.financial-details h3 {
    color: #00843D;
    font-size: 1.1em;
    margin-bottom: 1rem;
    font-weight: 600;
}

@media (max-width: 768px) {
    .assistance-tiles {
        gap: 0.4rem;
    }
    
    .view-tile {
        font-size: 0.85em;
        padding: 0.4rem 0.8rem;
    }
}

/* Shura Request Modal Items Table */
.shura-items-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 1.5rem;
    background: #f9fdfb;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 1px 4px rgba(0,0,0,0.04);
}
.shura-items-table th, .shura-items-table td {
    padding: 0.75rem 0.5rem;
    text-align: left;
    border-bottom: 1px solid #e6f3ed;
    font-size: 1rem;
}
.shura-items-table th {
    background: #00843D;
    color: #fff;
    font-weight: 600;
    text-transform: uppercase;
}
.shura-items-table tr:last-child td {
    border-bottom: none;
}
.shura-items-table .total-label {
    font-weight: bold;
    background: #f0f9f5;
}
.shura-items-table .total-amount {
    font-weight: bold;
    color: #00843D;
    background: #f0f9f5;
}
.shura-items-table input[type="number"] {
    width: 100%;
    padding: 4px 8px;
    border-radius: 4px;
    border: 1px solid #ccc;
    font-size: 1em;
}
.shura-items-table input[type="checkbox"] {
    transform: scale(1.2);
}
@media (max-width: 600px) {
    .shura-items-table th, .shura-items-table td {
        font-size: 0.95em;
        padding: 0.5rem 0.2rem;
    }
}

/* --- Tablet & Landscape Table/Modal Fixes --- */
.table-responsive {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}
.table-responsive table {
    min-width: 1000px;
}

/* Always allow modal content to scroll horizontally if needed */
.modal-content, .shura-modal .modal-content {
    overflow-x: auto;
}

@media (max-width: 1200px) and (orientation: landscape) {
    .modal-content, .shura-modal .modal-content {
        max-width: 98vw !important;
        width: 98vw !important;
        min-width: 600px;
        overflow-x: auto;
        box-sizing: border-box;
    }
}
/* --- End Tablet & Landscape Table/Modal Fixes --- */

.shura-amount {
  max-width: 90px;
  min-width: 60px;
  width: 100%;
  box-sizing: border-box;
}

.shura-items-table td:first-child, .shura-items-table th:first-child {
  max-width: 120px;
  min-width: 80px;
  white-space: normal;
  word-break: break-word;
  overflow: hidden;
  text-overflow: ellipsis;
}