/* Modern Design - Minimalist */
:root {
    --bg-page: #f4f7fb;
    --bg-surface: #ffffff;
    --text-strong: #1f2d3d;
    --text-muted: #627284;
    --border-soft: #d9e1ea;
    --brand-700: #1f3b59;
    --brand-600: #284e73;
    --brand-500: #2f628f;
    --accent: #0f766e;
}

* {
    scroll-behavior: smooth;
}

body {
    background: radial-gradient(circle at top left, #fbfdff 0%, var(--bg-page) 55%);
    min-height: 100vh;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    color: var(--text-strong);
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

.container.mt-5 {
    margin-top: 2rem !important;
}

/* Navbar */
.bg-gradient {
    background: linear-gradient(120deg, var(--brand-700), var(--brand-500)) !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.18);
}

.navbar {
    box-shadow: 0 8px 24px rgba(19, 41, 61, 0.18);
    padding-top: 0.72rem;
    padding-bottom: 0.72rem;
}

.navbar-brand {
    font-size: 1.05rem;
    letter-spacing: 0.02em;
}

.topbar-shell {
    display: flex;
    align-items: center;
    gap: 0.9rem;
    width: 100%;
    justify-content: flex-end;
}

.topbar-main-nav {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.topbar-user-pill {
    margin-right: 0.4rem;
    padding: 0.35rem 0.72rem;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.14);
    border: 1px solid rgba(255, 255, 255, 0.2);
    line-height: 1.2;
}

.topbar-user-pill small {
    opacity: 0.9;
    font-size: 0.74rem;
}

.topbar-link {
    border-radius: 999px;
    padding: 0.35rem 0.8rem !important;
    color: #f8f9fa !important;
    font-weight: 500;
}

.topbar-link:hover,
.topbar-link:focus {
    background: rgba(255, 255, 255, 0.16);
}

.topbar-actions {
    display: flex;
    align-items: center;
    gap: 0.45rem;
}

.topbar-action-btn {
    white-space: nowrap;
    border: 1px solid rgba(255, 255, 255, 0.45);
    color: #fff;
    background: transparent;
    border-radius: 999px;
    padding: 0.36rem 0.78rem;
    font-weight: 600;
}

.topbar-action-btn:hover,
.topbar-action-btn:focus {
    background: rgba(255, 255, 255, 0.18);
    border-color: rgba(255, 255, 255, 0.7);
    color: #fff;
}

.modal .btn {
    width: auto;
}

/* Cards */
.card {
    border: 1px solid var(--border-soft);
    border-radius: 12px;
    box-shadow: 0 6px 18px rgba(20, 44, 68, 0.08);
    transition: all 0.3s ease;
    background: var(--bg-surface);
}

.card:hover {
    box-shadow: 0 12px 28px rgba(20, 44, 68, 0.12);
}

/* Buttons */
.btn {
    border-radius: 8px;
    font-weight: 600;
    transition: all 0.2s ease;
    border-width: 1px;
}

.btn-primary {
    background-color: var(--brand-600);
    border-color: var(--brand-600);
    color: #fff;
    width: auto;
    padding: 0.62rem 1rem;
    font-size: 0.95rem;
}

.btn-primary:hover {
    background-color: var(--brand-700);
    border-color: var(--brand-700);
    box-shadow: 0 6px 14px rgba(31, 59, 89, 0.28);
}

.btn-secondary {
    background-color: #6a7785;
    border-color: #6a7785;
    color: white;
}

.btn-secondary:hover {
    background-color: #54606d;
    border-color: #54606d;
}

.btn-outline-secondary {
    color: #506172;
    border-color: #bcc8d4;
}

.btn-outline-secondary:hover {
    background-color: #5a6c7f;
    border-color: #5a6c7f;
    color: white;
}

.btn-outline-primary {
    color: var(--brand-600);
    border-color: #9db5cb;
}

.btn-outline-primary:hover {
    background-color: var(--brand-600);
    border-color: var(--brand-600);
    color: white;
}

.btn-warning { 
    background-color: #ffc107;
    color: #212529;
}

.btn-warning:hover { 
    background-color: #e0a800;
}

.btn-danger { 
    background-color: #dc3545;
}

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

.btn-outline-danger {
    color: #dc3545;
    border-color: #dc3545;
}

.btn-outline-danger:hover {
    background-color: #dc3545;
    border-color: #dc3545;
    color: white;
}

/* Titles */
h1 {
    color: var(--text-strong);
    font-weight: 700;
    margin-bottom: 1.4rem;
    letter-spacing: 0.01em;
}

h2, h3, h4, h5, h6 {
    color: #2a3f54;
    font-weight: 650;
}

/* Forms */
.form-control, .form-select {
    border-radius: 8px;
    border: 1px solid #ccd7e2;
    transition: all 0.2s ease;
    min-height: 2.5rem;
}

.form-control:focus, .form-select:focus {
    border-color: #8ca9c2;
    box-shadow: 0 0 0 0.18rem rgba(47, 98, 143, 0.14);
}

/* Alerts */
.alert {
    border-radius: 10px;
    border: 1px solid var(--border-soft);
    box-shadow: 0 6px 16px rgba(20, 44, 68, 0.08);
}

.alert-info {
    background-color: #d1ecf1;
    color: #0c5460;
    border-color: #bee5eb;
}

/* Login Container */
.login-container {
    max-width: 450px;
    margin: 5rem auto;
    padding: 3rem;
    background: var(--bg-surface);
    border-radius: 14px;
    box-shadow: 0 16px 36px rgba(20, 44, 68, 0.14);
    border: 1px solid var(--border-soft);
}

.login-container .btn-primary {
    width: 100%;
}

.login-container h2 {
    text-align: center;
    margin-bottom: 2rem;
    color: #2c3e50;
}

/* List Items */
.list-group-item {
    border: 1px solid var(--border-soft);
    border-radius: 6px;
    margin-bottom: 0.5rem;
    transition: all 0.2s ease;
}

.list-group-item:hover {
    background-color: #f8fbff;
    border-color: #9cb6cb;
}

/* Badge */
.badge {
    border-radius: 20px;
    padding: 0.5rem 1rem;
    background-color: #007bff;
}

/* Search Section */
.search-section {
    background: var(--bg-surface);
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 2rem;
    box-shadow: 0 8px 20px rgba(20, 44, 68, 0.08);
    border: 1px solid var(--border-soft);
}

.section-header {
    border-bottom: 2px solid #e9ecef;
    padding-bottom: 1.5rem;
    margin-bottom: 2rem;
}

.print-service-line {
    display: none;
}

.dashboard-actions .btn,
.table-actions .btn {
    white-space: nowrap;
}

.action-icon-btn {
    min-width: 2.2rem;
    min-height: 2.2rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0;
}

.sort-controls {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.sort-controls .btn {
    border-radius: 6px !important;
}

.equipment-mobile-meta {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.4rem;
    margin-bottom: 0.75rem;
}

.compact-type-line {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.2rem;
}

.compact-type-line > * {
    margin-left: 0 !important;
}

.compact-type-line small {
    font-size: 0.84rem;
    color: #5f6b76 !important;
    font-weight: 500;
    line-height: 1.2;
}

.equipment-type-text {
    display: inline-block;
    align-self: flex-start;
    margin-left: 0 !important;
    max-width: 18rem;
    color: #2c3e50;
    font-size: 1.02rem;
    font-weight: 800;
    line-height: 1.25;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    vertical-align: middle;
}

.equipment-mobile-meta small {
    color: var(--text-muted);
}

.mobile-service-list {
    margin-top: 0.5rem;
}

.mobile-service-list .list-group-item {
    margin-bottom: 0;
    border-radius: 0;
}

.mobile-service-list .list-group-item:first-child {
    border-top-left-radius: 6px;
    border-top-right-radius: 6px;
}

.mobile-service-list .list-group-item:last-child {
    border-bottom-left-radius: 6px;
    border-bottom-right-radius: 6px;
}

@media (max-width: 991.98px) {
    .topbar-shell {
        flex-direction: column;
        align-items: stretch;
        gap: 0.65rem;
        margin-top: 0.75rem;
    }

    .topbar-actions {
        margin: 0;
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 0.45rem;
    }

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

    .topbar-main-nav {
        flex-direction: column;
        align-items: stretch;
        gap: 0.35rem;
    }

    .topbar-user-pill {
        margin-right: 0;
        border-radius: 10px;
        text-align: left;
    }

    .topbar-link {
        border-radius: 8px;
    }

    .container.mt-5 {
        margin-top: 1.5rem !important;
    }

    .search-section {
        padding: 1rem;
    }

    .dashboard-actions {
        gap: 0.75rem !important;
    }

    .dashboard-actions > div,
    .dashboard-actions > button {
        width: 100%;
    }

    .dashboard-actions > div .btn,
    .dashboard-actions > button,
    .dashboard-actions form {
        width: 100%;
    }

    .dashboard-actions .d-flex {
        flex-direction: column;
    }

    .dashboard-actions .btn {
        width: 100%;
    }

    .table {
        font-size: 0.9rem;
    }

    .table td,
    .table th {
        vertical-align: top;
        white-space: normal;
    }

    .table-actions {
        display: flex;
        flex-direction: column;
        gap: 0.4rem;
        align-items: stretch;
    }

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

    .table {
        margin-bottom: 0;
    }

    .table thead th {
        background: #f2f6fa;
        border-bottom: 1px solid #d4dde7;
        color: #40556a;
        font-size: 0.79rem;
        font-weight: 700;
        text-transform: uppercase;
        letter-spacing: 0.04em;
        vertical-align: middle;
    }

    .table td,
    .table th {
        border-color: #e3e9f0;
    }

    .table-responsive {
        border-radius: 12px;
        border: 1px solid #dde4ec;
    }

    .login-container {
        margin: 1.25rem auto;
        padding: 1.25rem;
    }
}

@media (max-width: 767.98px) {
    .topbar-actions {
        grid-template-columns: 1fr;
    }

    .equipment-type-text {
        max-width: 11.5rem;
    }

    .mobile-hidden-table {
        display: none;
    }

    .equipment-mobile-card .card-body {
        padding: 0.9rem;
    }

    .equipment-mobile-card h5 {
        font-size: 1rem;
        margin-bottom: 0.5rem;
    }

    .equipment-mobile-actions {
        display: flex;
        flex-direction: column;
        gap: 0.4rem;
        margin-top: 0.75rem;
    }

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

@media (min-width: 768px) {
    .mobile-card-list {
        display: none;
    }
}

@media (max-width: 575.98px) {
    h1 {
        font-size: 1.6rem;
        margin-bottom: 1rem;
    }

    .section-header {
        margin-bottom: 1rem;
        padding-bottom: 1rem;
    }

    .card {
        border-radius: 6px;
    }

    .btn {
        padding: 0.65rem 0.75rem;
    }
}

@media print {
    .no-print,
    .navbar,
    .btn,
    button,
    form {
        display: none !important;
    }

    body {
        background: #fff !important;
        color: #000 !important;
    }

    .container {
        max-width: 100% !important;
        width: 100% !important;
        margin: 0 !important;
        padding: 0 !important;
    }

    .card,
    .search-section,
    .section-header {
        box-shadow: none !important;
        border: 0 !important;
    }

    .table {
        font-size: 12px;
    }

    .print-hide-actions {
        display: none !important;
    }

    .screen-service-card {
        display: none !important;
    }

    .mobile-card-list {
        display: none !important;
    }

    .mobile-hidden-table {
        display: table !important;
    }

    .print-service-line {
        display: block !important;
        font-size: 11px;
        line-height: 1.35;
        margin: 2px 0;
        padding: 2px 0;
        border-bottom: 1px dotted #bbb;
    }

}