/* ===================================================================
   Iceburg683 - Site Stylesheet
   Clean, professional design aligned with the Iceburg brand palette:
   dark teal-slate (#1F3741), steel-blue accents, white & light greys.
   =================================================================== */

/* --- Navbar --- */
.navbar-portal {
    background-color: #1f3741;
    padding-top: 0;
    padding-bottom: 0;
    min-height: 46px;
}

.navbar-portal-brand {
    display: flex;
    align-items: center;
    padding: 8px 16px 8px 0;
}

.navbar-portal-brand:hover {
    opacity: 0.9;
}

.navbar-portal-link {
    color: rgba(255, 255, 255, 0.85) !important;
    font-size: 0.9rem;
    padding: 14px 12px !important;
    white-space: nowrap;
}

.navbar-portal-link:hover,
.navbar-portal-link:focus {
    color: #ffffff !important;
    background-color: rgba(255, 255, 255, 0.08);
}

.navbar-portal .navbar-toggler {
    border-color: rgba(255, 255, 255, 0.3);
}

.navbar-portal .navbar-toggler-icon {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='rgba%28255, 255, 255, 0.75%29' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e");
}

.navbar-portal-dropdown {
    background-color: #1f3741;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 4px;
    min-width: 160px;
    padding: 4px 0;
    margin-top: 0 !important;
}

.navbar-portal-dropdown-item {
    color: rgba(255, 255, 255, 0.85) !important;
    font-size: 0.875rem;
    padding: 8px 16px;
}

.navbar-portal-dropdown-item:hover,
.navbar-portal-dropdown-item:focus {
    color: #ffffff !important;
    background-color: rgba(255, 255, 255, 0.1);
}

.navbar-portal-dropdown .dropdown-divider {
    border-color: rgba(255, 255, 255, 0.15);
}

/* --- Second level dropdowns (Operations menu groups) --- */
/* Bootstrap 5 has no built-in submenu, so the flyout is done here. */
.dropdown-submenu {
    position: relative;
}

.dropdown-submenu > .dropdown-menu {
    top: 0;
    left: 100%;
    margin-top: -5px;
    margin-left: 0;
}

/* Caret pointing right rather than down, since the submenu opens sideways */
.dropdown-submenu > .dropdown-toggle::after {
    display: inline-block;
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    border-top: 0.3em solid transparent;
    border-bottom: 0.3em solid transparent;
    border-left: 0.3em solid;
    border-right: 0;
}

.dropdown-submenu > .dropdown-toggle {
    padding-right: 32px;
}

/* Desktop: open the flyout on hover, matching the top level menus */
@media (min-width: 576px) {
    .dropdown-submenu:hover > .dropdown-menu {
        display: block;
    }
}

/* Mobile: the navbar collapses, so nest the submenu inline instead of flying out */
@media (max-width: 575.98px) {
    .dropdown-submenu > .dropdown-menu {
        position: static;
        left: 0;
        margin-left: 12px;
        border: 0;
        border-left: 1px solid rgba(255, 255, 255, 0.15);
        border-radius: 0;
    }

    .dropdown-submenu > .dropdown-toggle::after {
        position: static;
        transform: none;
        border-top: 0.3em solid;
        border-bottom: 0;
        border-left: 0.3em solid transparent;
        border-right: 0.3em solid transparent;
        margin-left: 0.4em;
    }
}

/* --- Base --- */
html {
    font-size: 14px;
    position: relative;
    min-height: 100%;
}

@media (min-width: 768px) {
    html {
        font-size: 16px;
    }
}

body {
    margin-bottom: 60px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background-color: #f5f7f8;
    color: #22333b;
}

/* --- Links --- */
a {
    color: #2c5a68;
}

a:hover {
    color: #1f3741;
}

/* --- Focus Styles --- */
.btn:focus, .btn:active:focus, .btn-link.nav-link:focus, .form-control:focus, .form-check-input:focus {
    box-shadow: 0 0 0 0.1rem white, 0 0 0 0.25rem #7f9faa;
}

.form-control:focus, .form-select:focus {
    border-color: #7f9faa;
    box-shadow: 0 0 0 0.2rem rgba(127, 159, 170, 0.25);
}

/* --- Buttons --- */
/* Primary button - use for the main action on the page (1 Primary, rest Secondary) */
.btn-primary {
    color: #fff;
    background-color: #1f3741;
    border-color: #1a2f37;
}

.btn-primary:hover {
    color: #fff;
    background-color: #16272e;
    border-color: #101d22;
}

.btn-primary:active, .btn-primary:focus {
    background-color: #101d22;
    border-color: #0a1418;
}

/* Secondary button - use for all other actions */
.btn-secondary {
    color: #333;
    background-color: #f0f0f0;
    border-color: #ccc;
}

.btn-secondary:hover {
    color: #333;
    background-color: #e0e0e0;
    border-color: #adadad;
}

.btn-secondary:active, .btn-secondary:focus {
    background-color: #d4d4d4;
    border-color: #8c8c8c;
}

/* Danger button */
.btn-danger {
    color: #fff;
    background-color: #d9534f;
    border-color: #d43f3a;
}

.btn-danger:hover {
    color: #fff;
    background-color: #c9302c;
    border-color: #ac2925;
}

/* Button transition for smooth hover effect */
.btn {
    transition: all 0.2s ease-in-out;
}

/* --- Layout --- */
.border-top {
    border-top: 1px solid #e5e5e5;
}

.border-bottom {
    border-bottom: 1px solid #e5e5e5;
}

.box-shadow {
    box-shadow: 0 .25rem .75rem rgba(0, 0, 0, .05);
}

.footer {
    position: absolute;
    bottom: 0;
    width: 100%;
    white-space: nowrap;
    line-height: 60px;
    font-size: 0.85rem;
}

/* --- Navbar --- */
.navbar-brand {
    white-space: normal;
    display: flex;
    align-items: center;
}

.nav-pills .nav-link.active, .nav-pills .show > .nav-link {
    color: #fff;
    background-color: #1f3741;
    border-color: #1a2f37;
}

/* --- Tables --- */
.table {
    font-size: 0.8rem;
    border-collapse: collapse;
    margin-bottom: 0;
}

/* Table header - dark, bold, tight */
.table thead th {
    background-color: #1f3741;
    color: #fff;
    font-weight: 700;
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    border: none;
    padding: 8px 10px;
    vertical-align: middle;
    white-space: nowrap;
}

.table thead th a {
    color: #fff;
    text-decoration: none;
}

.table thead th a:hover {
    color: #cfe0e5;
    text-decoration: underline;
}

/* Body rows — compact, clean */
.table tbody td {
    padding: 5px 10px;
    vertical-align: middle;
    border-top: 1px solid #e5eaec;
    border-bottom: none;
    color: #22333b;
}

/* Stripe: disabled — all rows white */
.table-striped > tbody > tr:nth-of-type(odd) > *,
.table-striped > tbody > tr:nth-of-type(even) > * {
    background-color: #ffffff;
}

/* Hover: clear highlight like the screenshot */
.table-hover > tbody > tr:hover > * {
    background-color: #eef2f4 !important;
    color: #111;
}

/* Wrap the table for a card-like border.
   overflow-x must scroll, not hide. A hidden overflow clips wide tables so the
   Actions column becomes unreachable, and the table still forces the page sideways. */
.table-responsive,
.table-wrapper {
    border: 1px solid #d3dade;
    border-radius: 4px;
    overflow-x: auto;
    overflow-y: hidden;
    max-width: 100%;
}

/* Full width page container, used by the wide Operations registers.
   Keeps the same left and right breathing room as the fixed container. */
.page-container-wide {
    padding-left: 24px;
    padding-right: 24px;
}

/* An action link never breaks mid-word, so the Actions column stays readable */
.table-action-link {
    white-space: nowrap;
}

/* Date cells stay on one line rather than splitting the date across two rows */
.table tbody td.date-cell,
.table tbody td.nowrap-cell {
    white-space: nowrap;
}

/* Keep the scrollbar unobtrusive on the wide compliance registers */
.table-wrapper::-webkit-scrollbar {
    height: 8px;
}

.table-wrapper::-webkit-scrollbar-thumb {
    background-color: #c2ccd1;
    border-radius: 4px;
}

.table-wrapper::-webkit-scrollbar-track {
    background-color: #f2f5f6;
}

/* Sortable table styles */
.sortable th {
    cursor: pointer;
    position: relative;
    user-select: none;
}

.sortable th:hover {
    background-color: #16272e;
}

.sortable th::after {
    content: '\2195';
    position: absolute;
    right: 8px;
    opacity: 0.35;
    font-size: 0.7rem;
}

.sortable th.sort-asc::after {
    content: '\2191';
    opacity: 1;
}

.sortable th.sort-desc::after {
    content: '\2193';
    opacity: 1;
}

/* No-sort column: hide the sort indicator */
.sortable th.no-sort {
    cursor: default;
}

.sortable th.no-sort::after {
    content: '';
}

/* --- Action Links in Tables --- */
.table-action-link {
    color: #2c5a68;
    text-decoration: none;
    font-size: 0.78rem;
    white-space: nowrap;
}

.table-action-link:hover {
    color: #1f3741;
    text-decoration: underline;
}

/* --- Image File Links (reports) --- */
.image-file-link {
    color: #1a5276;
    text-decoration: none;
    font-size: 0.88rem;
    font-weight: 500;
    white-space: nowrap;
}

.image-file-link:hover {
    color: #0d3349;
    text-decoration: underline;
}

/* --- Image Link Box (attached images card) --- */
.image-link-box {
    border: 1px solid #b0c4d8;
    border-radius: 5px;
    background-color: #f0f5fa;
    overflow: hidden;
}

.image-link-box-header {
    background-color: #d0e3f0;
    color: #1a3a52;
    font-size: 0.78rem;
    font-weight: 600;
    padding: 5px 10px;
    border-bottom: 1px solid #b0c4d8;
    letter-spacing: 0.02em;
}

.image-link-box ul {
    padding: 8px 12px;
    margin: 0;
}

.image-link-box li {
    padding: 2px 0;
}

.table-action-delete {
    color: #c0392b;
}

.table-action-delete:hover {
    color: #922b21;
}

/* --- Action Icons in Tables --- */
.action-icon {
    width: 18px;
    height: 18px;
    margin: 0 4px;
    opacity: 0.7;
    transition: opacity 0.2s ease-in-out, transform 0.2s ease-in-out;
}

.action-icon:hover {
    opacity: 1;
    transform: scale(1.15);
}

/* --- Cards --- */
.card {
    border: 1px solid #dee2e6;
    border-radius: 6px;
}

/* --- Forms --- */
.form-floating > .form-control-plaintext::placeholder, .form-floating > .form-control::placeholder {
    color: var(--bs-secondary-color);
    text-align: end;
}

.form-floating > .form-control-plaintext:focus::placeholder, .form-floating > .form-control:focus::placeholder {
    text-align: start;
}

/* --- Alerts --- */
.alert {
    font-size: 0.9rem;
}

/* --- Login Page --- */
.login-container {
    max-width: 400px;
    margin: 0 auto;
}

/* --- Job Card Feed Items (Activities / Comments / Invoice) --- */
.jc-feed-item {
    border-bottom: 1px solid #e9ecef;
    padding: 10px 0;
}

.jc-feed-item:last-child {
    border-bottom: none;
}

.jc-feed-completed {
    opacity: 0.7;
}

.jc-feed-title {
    font-weight: 600;
    font-size: 0.88rem;
    margin-bottom: 2px;
}

.jc-feed-body {
    font-size: 0.85rem;
    color: #444;
    margin-bottom: 3px;
}

.jc-feed-meta {
    font-size: 0.78rem;
    color: #888;
    margin-bottom: 3px;
}

.jc-feed-sep {
    margin: 0 5px;
    color: #bbb;
}

.jc-feed-remark {
    font-size: 0.8rem;
    color: #555;
    font-style: italic;
    margin-bottom: 3px;
}

.jc-feed-actions {
    font-size: 0.78rem;
    margin-top: 2px;
}

.jc-feed-badge-done {
    display: inline-block;
    background: #e8f5e9;
    color: #2e7d32;
    border-radius: 4px;
    padding: 0 6px;
    font-size: 0.73rem;
    font-weight: 600;
}

.jc-feed-badge-open {
    display: inline-block;
    background: #fff3e0;
    color: #e65100;
    border-radius: 4px;
    padding: 0 6px;
    font-size: 0.73rem;
    font-weight: 600;
}

/* --- Job Card Steps (new activity/comment feed) --- */
.jc-step {
    padding: 10px 0;
    border-bottom: 1px solid #e9ecef;
}

.jc-step:last-child {
    border-bottom: none;
}

.jc-step-head {
    display: flex;
    align-items: center;
    gap: 8px;
}

.jc-step-name {
    font-weight: 700;
    font-size: 0.9rem;
    color: #212529;
    text-decoration: none;
}

.jc-step-link {
    color: #337ab7;
    cursor: pointer;
}

.jc-step-link:hover {
    color: #1a5276;
    text-decoration: underline;
}

.jc-step-completed .jc-step-name {
    color: #6c757d;
}

.jc-step-remark {
    font-size: 0.8rem;
    color: #495057;
    margin-top: 3px;
}

.jc-step-foot {
    font-size: 0.75rem;
    color: #868e96;
    font-style: italic;
    margin-top: 4px;
}

.jc-pill {
    display: inline-block;
    border-radius: 10px;
    padding: 1px 9px;
    font-size: 0.72rem;
    font-weight: 600;
    color: #fff;
}

.jc-pill-done {
    background: #2e7d32;
}

.jc-pill-progress {
    background: #e67e22;
}

/* --- Job Card Comments --- */
.jc-comment-header {
    font-weight: 700;
    font-size: 0.9rem;
    color: #212529;
}

.jc-comment-body {
    font-size: 0.82rem;
    color: #343a40;
    margin-top: 2px;
}
}