@import url("../../vendor/sweetalert2/sweetalert2.min.css");

:root {
    --dash-bg: #f5f7fa;
    --dash-panel: #ffffff;
    --dash-sidebar: #1f2937;
    --dash-sidebar-soft: #273446;
    --dash-text: #101828;
    --dash-muted: #667085;
    --dash-line: #e4e7ec;
    --dash-accent: #2f5d31;
    --dash-accent-soft: #eef6ef;
}

* {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    padding: 0;
}

body {
    font-family: "Segoe UI", Tahoma, sans-serif;
    color: var(--dash-text);
    background: var(--dash-bg);
}

.dashboard-shell {
    min-height: 100vh;
    display: grid;
    grid-template-columns: 280px 1fr;
}

.dashboard-sidebar {
    background: linear-gradient(180deg, var(--dash-sidebar), var(--dash-sidebar-soft));
    color: #eef2ff;
    padding: 1rem 0.9rem;
    display: flex;
    flex-direction: column;
    gap: 0.9rem;
    border-right: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: none;
    position: sticky;
    top: 0;
    height: 100vh;
    overflow: auto;
}

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.65rem 0.7rem;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.sidebar-brand img {
    width: 46px;
    height: 46px;
    object-fit: contain;
}

.sidebar-brand h1 {
    margin: 0;
    font-size: 0.96rem;
    font-weight: 700;
    letter-spacing: 0.01em;
}

.sidebar-brand p {
    margin: 0.1rem 0 0;
    font-size: 0.84rem;
    opacity: 0.9;
}

.sidebar-menu {
    display: grid;
    gap: 0.4rem;
    padding-top: 0.25rem;
}

.sidebar-menu .nav-link {
    color: #d1d5db;
    text-align: left;
    border-radius: 10px;
    padding: 0.74rem 0.88rem;
    font-weight: 650;
    border: 1px solid transparent;
    transition: all 0.2s ease;
    position: relative;
    background: transparent;
    text-decoration: none;
}

.sidebar-menu .nav-link:hover {
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
    transform: none;
}

.sidebar-menu .nav-link.active {
    background: #e7f0e5;
    color: #1e3c22;
    border-color: #d6e4d2;
    box-shadow: none;
}

.sidebar-menu .nav-link.active::before {
    content: "";
    position: absolute;
    left: 0.45rem;
    top: 50%;
    transform: translateY(-50%);
    width: 4px;
    height: 55%;
    border-radius: 8px;
    background: #295329;
}

.sidebar-footer {
    margin-top: auto;
    display: flex;
    flex-direction: column;
    gap: 0.55rem;
    padding-top: 0.4rem;
}

.sidebar-footer .btn {
    border-radius: 11px;
    height: 44px;
    font-weight: 650;
}
.sidebar-action-btn {
    width: 100%;
    height: 46px;
    border-radius: 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.96rem;
    font-weight: 700;
    letter-spacing: 0.01em;
    text-decoration: none;
    transition: all 0.18s ease;
}
.sidebar-action-public {
    color: #eff4f9;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(223, 233, 244, 0.8);
}
.sidebar-action-public:hover,
.sidebar-action-public:focus {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.12);
    border-color: rgba(237, 244, 252, 0.95);
}
.sidebar-action-logout {
    color: #ffffff;
    background: linear-gradient(135deg, #aa2f2f, #8f2424);
    border: 1px solid #7f2020;
    box-shadow: 0 6px 14px rgba(127, 32, 32, 0.24);
}
.sidebar-action-logout:hover,
.sidebar-action-logout:focus {
    color: #ffffff;
    background: linear-gradient(135deg, #922626, #7a1f1f);
    border-color: #6b1b1b;
    box-shadow: 0 8px 18px rgba(110, 28, 28, 0.3);
}
.sidebar-action-btn:focus-visible {
    outline: 2px solid rgba(214, 231, 210, 0.9);
    outline-offset: 2px;
}

.dashboard-main {
    padding: 1.25rem;
}

.dashboard-topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1.1rem;
    padding: 0.95rem 1rem;
    border-radius: 12px;
    background: #ffffff;
    border: 1px solid var(--dash-line);
}

.dashboard-topbar h2 {
    margin: 0;
    font-size: 1.35rem;
    font-weight: 700;
}

.dashboard-topbar p {
    margin: 0.2rem 0 0;
    color: var(--dash-muted);
    font-size: 0.9rem;
}

.user-badge {
    background: var(--dash-accent-soft);
    color: #1b5e20;
    border: 1px solid rgba(46, 125, 50, 0.3);
    border-radius: 999px;
    padding: 0.35rem 0.8rem;
    font-weight: 700;
    font-size: 0.82rem;
}

.dashboard-timestamp {
    color: #6d7a68;
    font-size: 0.78rem;
    font-weight: 600;
}

.dashboard-stats {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.stats-card {
    background: #fff;
    border: 1px solid var(--dash-line);
    border-radius: 12px;
    padding: 0.85rem 0.95rem;
    box-shadow: none;
}
.stats-card-link {
    display: block;
    text-decoration: none;
    color: inherit;
    transition: transform 0.16s ease, border-color 0.16s ease, box-shadow 0.16s ease;
}
.stats-card-link:hover {
    transform: translateY(-2px);
    border-color: #d0dcc6;
    box-shadow: 0 8px 20px rgba(16, 24, 40, 0.06);
}
.stats-card-link:focus-visible {
    outline: 2px solid #7ea66f;
    outline-offset: 2px;
}

.stats-card span {
    display: block;
    color: #5a6a51;
    font-size: 0.76rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-weight: 700;
}

.stats-card strong {
    display: block;
    font-size: 1.7rem;
    line-height: 1.15;
    margin-top: 0.3rem;
    color: #1a2f17;
}

.stats-card small {
    color: #70826a;
    font-weight: 500;
}

.dashboard-content {
    display: grid;
    gap: 1rem;
}

.dashboard-main .alert {
    border-radius: 12px;
    border: 1px solid transparent;
    font-weight: 600;
    margin-bottom: 0.9rem;
}

.dashboard-main .alert-success {
    background: #ecf8ee;
    border-color: #c7e8cf;
    color: #1d5a2a;
}

.dashboard-main .alert-danger {
    background: #fdf1f1;
    border-color: #f3cdcd;
    color: #8a1f1f;
}

.dashboard-table thead th {
    background: #f7f9fc;
    color: #1f2a37;
    font-weight: 700;
    border-bottom: 1px solid #dbe3ea;
    padding: 0.78rem 0.72rem;
    font-size: 0.8rem;
    letter-spacing: 0.02em;
    text-transform: uppercase;
}

.dashboard-table td,
.dashboard-table th {
    vertical-align: middle;
    padding: 0.72rem;
}

.dashboard-table tbody tr {
    transition: background-color 0.16s ease;
}

.dashboard-table tbody tr:hover {
    background: #f9fbff;
}

.dashboard-data-table {
    margin-bottom: 0;
}

.table-responsive {
    border: 1px solid #e4e9f0;
    border-radius: 12px;
    overflow: hidden;
    background: #fff;
}

.structure-thumb {
    width: 58px;
    height: 58px;
    object-fit: cover;
    border-radius: 8px;
    border: 1px solid #d6dde6;
}

.dataTables_wrapper .dataTables_filter input {
    border: 1px solid #cdd7e1;
    border-radius: 10px;
    padding: 0.35rem 0.56rem;
    min-width: 230px;
}

.dataTables_wrapper .dataTables_length select {
    border: 1px solid #cdd7e1;
    border-radius: 10px;
    padding: 0.28rem 1.8rem 0.28rem 0.55rem;
}

.dataTables_wrapper .dataTables_paginate .paginate_button.current,
.dataTables_wrapper .dataTables_paginate .paginate_button.current:hover {
    background: #e5efdd !important;
    border-color: #c9d9bb !important;
    color: #203a1b !important;
    border-radius: 8px;
}

.dataTables_wrapper .dataTables_paginate .paginate_button:hover {
    background: #f0f5eb !important;
    border-color: #d5e0ca !important;
    color: #213427 !important;
}

.dataTables_wrapper .dataTables_info,
.dataTables_wrapper .dataTables_paginate,
.dataTables_wrapper .dataTables_length,
.dataTables_wrapper .dataTables_filter {
    margin-top: 0.35rem;
    margin-bottom: 0.35rem;
}

.panel-card {
    background: var(--dash-panel);
    border: 1px solid var(--dash-line);
    border-radius: 12px;
    padding: 1.05rem;
    box-shadow: none;
}

.panel-card h3 {
    margin: 0 0 1rem;
    font-size: 1.1rem;
    font-weight: 700;
}

.panel-title {
    margin-bottom: 0.95rem;
}

.panel-title h3 {
    margin-bottom: 0.25rem;
}

.panel-title p {
    margin: 0;
    color: #6a766f;
    font-size: 0.9rem;
}

.panel-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.panel-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.panel-actions form {
    margin: 0;
}

.panel-head span {
    font-size: 0.8rem;
    font-weight: 700;
    color: #1b5e20;
    background: var(--dash-accent-soft);
    border: 1px solid rgba(46, 125, 50, 0.25);
    border-radius: 999px;
    padding: 0.25rem 0.65rem;
}

.form-block {
    border: 1px solid var(--dash-line);
    border-radius: 12px;
    padding: 0.95rem;
    background: #f8fafc;
}

.minimal-accordion .accordion-item {
    border: 1px solid var(--dash-line);
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 0.6rem;
    box-shadow: none;
}

.minimal-accordion .accordion-button {
    background: #f8fafc;
    color: #0f172a;
    font-weight: 600;
    box-shadow: none;
}

.minimal-accordion .accordion-button:not(.collapsed) {
    background: #edf7ee;
    color: #1b5e20;
}

.minimal-accordion .accordion-button:focus {
    box-shadow: 0 0 0 0.2rem rgba(46, 125, 50, 0.2);
}

.bridge-detail-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.45rem 0.85rem;
    padding: 0.75rem;
    border: 1px dashed #cbd5e1;
    border-radius: 12px;
    background: #f8fafc;
    font-size: 0.88rem;
}

.bridge-detail-full {
    grid-column: 1 / -1;
}

.photo-manager {
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 0.75rem;
    background: #fcfdfd;
}

.bridge-photo-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 0.9rem;
    margin-bottom: 0.8rem;
}

.bridge-photo-item {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 0.5rem;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    background: #fff;
    padding: 0.55rem;
    min-height: 100%;
}

.bridge-photo-trigger {
    border: 0;
    padding: 0;
    background: transparent;
    border-radius: 10px;
    overflow: hidden;
    cursor: zoom-in;
}

.bridge-photo-item img {
    width: 100%;
    height: 145px;
    object-fit: cover;
    border-radius: 8px;
    border: 1px solid #d7dee8;
}

.bridge-photo-meta {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.45rem;
}

.bridge-photo-meta small {
    color: #556170;
    font-weight: 600;
}

.dashboard-modal .modal-header {
    border-bottom: 1px solid #e7ebf0;
    padding: 0.95rem 1rem;
}

.dashboard-modal .modal-title {
    font-weight: 700;
    color: #1b2f18;
    letter-spacing: 0.01em;
}

.dashboard-modal .modal-content {
    border: 1px solid #dbe2ea;
    border-radius: 14px;
    overflow: hidden;
    box-shadow: 0 20px 34px rgba(15, 23, 42, 0.18);
}

.dashboard-modal .modal-body {
    padding: 1.05rem;
}

.upload-photo-form {
    display: block;
}

.dashboard-main .form-control,
.dashboard-main .form-select {
    min-height: 44px;
    border-radius: 11px;
    border: 1px solid #d0d7de;
    padding: 0.58rem 0.78rem;
    font-size: 0.95rem;
}

.dashboard-main .form-control:focus,
.dashboard-main .form-select:focus {
    border-color: rgba(46, 125, 50, 0.55);
    box-shadow: 0 0 0 0.2rem rgba(46, 125, 50, 0.15);
}

.dashboard-main .form-label {
    font-weight: 600;
    color: #283b28;
    margin-bottom: 0.38rem;
}

.dashboard-main textarea.form-control {
    min-height: 120px;
    resize: vertical;
}

.dashboard-modal-form .form-check {
    background: #f7faf7;
    border: 1px solid #d9e3d9;
    border-radius: 10px;
    padding: 0.5rem 0.75rem 0.5rem 2rem;
}

.dashboard-inline-form {
    background: #f8fafc;
    border: 1px solid #e3e9ef;
    border-radius: 10px;
    padding: 0.6rem;
}

.btn {
    border-radius: 10px;
}

.btn-action-primary {
    min-height: 42px;
    padding-left: 1rem;
    padding-right: 1rem;
}

.btn-table-action {
    min-height: 34px;
    min-width: 78px;
    font-weight: 600;
}

.btn-outline-danger {
    border-color: rgba(176, 45, 45, 0.5);
    color: #9d2323;
}

.btn-outline-danger:hover,
.btn-outline-danger:focus {
    background: rgba(176, 45, 45, 0.09);
    border-color: #9d2323;
    color: #7e1b1b;
}

.dashboard-login-page {
    min-height: 100vh;
    background: linear-gradient(135deg, #1f2937, #334155);
}

.dashboard-login-wrap {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.dashboard-login-shell {
    width: min(980px, 100%);
    display: grid;
    grid-template-columns: 1fr 1fr;
    border-radius: 14px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.18);
    box-shadow: 0 12px 28px rgba(2, 6, 23, 0.3);
    background: #fff;
}

.dashboard-login-branding {
    padding: 2rem 1.6rem;
    background: linear-gradient(155deg, #1e3a2a, #2f5d31);
    color: #f3f5ec;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.dashboard-login-logo {
    width: 76px;
    height: 76px;
    object-fit: contain;
    margin-bottom: 1rem;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.95);
    padding: 0.35rem;
}

.dashboard-login-kicker {
    margin: 0;
    font-size: 0.78rem;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: rgba(241, 229, 187, 0.88);
    font-weight: 700;
}

.dashboard-login-branding h1 {
    margin: 0.45rem 0 0.7rem;
    font-size: 2rem;
    line-height: 1.15;
    font-weight: 800;
}

.dashboard-login-desc {
    margin: 0;
    color: rgba(236, 240, 222, 0.9);
    line-height: 1.6;
}

.dashboard-login-back-link {
    display: inline-flex;
    align-items: center;
    margin-top: 1.3rem;
    color: #f1e5bb;
    font-weight: 600;
    text-decoration: none;
}

.dashboard-login-back-link:hover {
    color: #fff3c7;
}

.dashboard-login-panel {
    padding: 2rem 1.6rem;
    background: #fff;
}

.dashboard-login-head h2 {
    margin: 0;
    font-size: 1.55rem;
    font-weight: 700;
    color: #152012;
}

.dashboard-login-head p {
    margin: 0.4rem 0 1.2rem;
    color: var(--dash-muted);
}

.login-input {
    height: 46px;
    border-radius: 12px;
    border: 1px solid #d0d5dd;
    padding: 0.55rem 0.8rem;
}

.login-input:focus {
    border-color: rgba(46, 125, 50, 0.65);
    box-shadow: 0 0 0 0.24rem rgba(46, 125, 50, 0.18);
}

.login-submit-btn {
    height: 46px;
    border-radius: 12px;
    font-weight: 700;
}

@media (max-width: 991.98px) {
    .dashboard-shell {
        grid-template-columns: 1fr;
    }

    .dashboard-sidebar {
        position: relative;
        height: auto;
        overflow: visible;
        border-right: 0;
        border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    }

    .sidebar-footer {
        flex-direction: row;
    }

    .sidebar-footer .btn {
        flex: 1;
    }

    .sidebar-action-btn {
        height: 44px;
        font-size: 0.9rem;
    }

    .dashboard-login-shell {
        grid-template-columns: 1fr;
    }

    .dashboard-login-branding {
        padding: 1.35rem 1.2rem;
    }

    .dashboard-login-branding h1 {
        font-size: 1.6rem;
    }

    .dashboard-login-panel {
        padding: 1.35rem 1.2rem;
    }

    .dashboard-stats {
        grid-template-columns: 1fr;
    }

    .panel-head {
        flex-direction: column;
        align-items: stretch;
    }

    .panel-actions {
        width: 100%;
    }

    .panel-actions .btn,
    .panel-actions form,
    .panel-actions form .btn {
        width: 100%;
    }

    .dataTables_wrapper .dataTables_filter input {
        min-width: 100%;
    }

    .dataTables_wrapper .dataTables_length,
    .dataTables_wrapper .dataTables_filter {
        width: 100%;
        text-align: left;
    }

    .bridge-detail-grid {
        grid-template-columns: 1fr;
    }

    .bridge-photo-item {
        gap: 0.45rem;
    }

    .bridge-photo-item img {
        width: 100%;
        height: 140px;
    }

    .bridge-photo-list {
        grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
    }

    .bridge-photo-meta {
        width: 100%;
        align-items: flex-start;
    }
}

.btn-success {
    background: linear-gradient(135deg, #2f4a21, #3e612b);
    border-color: #2f4a21;
    color: #f6f8ee;
    font-weight: 700;
}

.btn-success:hover,
.btn-success:focus,
.btn-success:active,
.btn-success.active {
    background: linear-gradient(135deg, #253c1a, #334f24);
    border-color: #253c1a;
    color: #ffffff;
}

.btn-success:focus-visible {
    box-shadow: 0 0 0 0.2rem rgba(65, 95, 42, 0.28);
}

.btn-outline-success {
    color: #2f4a21;
    border-color: rgba(47, 74, 33, 0.55);
}

.btn-outline-success:hover,
.btn-outline-success:focus,
.btn-outline-success:active {
    background: rgba(47, 74, 33, 0.1);
    border-color: #2f4a21;
    color: #1f3216;
}
