* {
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #f6f8f6;
    margin: 0;
    padding: 30px;
    color: #1e1e1e;
    line-height: 1.5;
    font-weight: 500;
}

.page-wrap {
    max-width: 1200px;
    margin: 0 auto;
}

.topbar {
    background: #fff;
    border-radius: 10px;
    padding: 14px 22px;
    margin-bottom: 25px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    border-left: 4px solid #6bbf59;
    font-size: 14px;
    font-weight: 600;
}

.topbar a {
    color: #2f5f9e;
    font-weight: 700;
}

.topbar a:hover {
    text-decoration: underline;
}

.card {
    background: #fff;
    border-radius: 10px;
    padding: 28px 30px;
    margin-bottom: 25px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.07);
    border-top: 4px solid #6bbf59;
}

.card h3 {
    margin-top: 0;
    margin-bottom: 22px;
    color: #2f5233;
    font-size: 21px;
    font-weight: 800;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 18px 24px;
    align-items: end;
}

.field {
    display: flex;
    flex-direction: column;
}

.field label {
    font-size: 13px;
    font-weight: 700;
    color: #333;
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: 0.4px;
}

.field-full {
    grid-column: 1 / -1;
}

input[type="text"],
input[type="password"],
input[type="date"],
input[type="file"],
select,
textarea {
    padding: 10px 12px;
    border: 1.5px solid #c8ccd1;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    font-family: inherit;
    background: #fcfdfc;
    width: 100%;
    color: #1e1e1e;
}

textarea {
    resize: vertical;
}

input[type="text"]:focus,
input[type="password"]:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: #6bbf59;
    box-shadow: 0 0 0 3px rgba(107,191,89,0.15);
}

.current-photo {
    margin-bottom: 8px;
}

.current-photo img {
    border-radius: 6px;
    border: 1px solid #e0e0e0;
}

button {
    background-color: #6bbf59;
    color: white;
    padding: 10px 22px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 700;
    margin-top: 6px;
}

button:hover {
    background-color: #57a349;
}

.search-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
    margin-bottom: 20px;
}

.search-bar input[type="text"] {
    flex: 1;
    min-width: 220px;
}

.search-bar select {
    width: auto;
}

.search-bar a {
    color: #4a4a4a;
    font-size: 14px;
    font-weight: 700;
}

.table-wrap {
    background: #fff;
    border-radius: 10px;
    overflow-x: auto;
    box-shadow: 0 2px 10px rgba(0,0,0,0.07);
}

table {
    border-collapse: collapse;
    width: 100%;
}

th, td {
    text-align: left;
    padding: 12px 14px;
    font-size: 14px;
}

td {
    font-weight: 600;
}

th {
    background-color: #2f5233;
    color: white;
    font-weight: 800;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

td {
    border-bottom: 1px solid #eef0ee;
}

tr:nth-child(even) td {
    background-color: #fafbfa;
}

tr:hover td {
    background-color: #eef6ec;
}

.action-links a {
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 13px;
    font-weight: 700;
    text-decoration: none;
    margin-right: 4px;
}

.action-links a.edit-link {
    background: #e8f1fb;
    color: #2f5f9e;
}

.action-links a.delete-link {
    background: #fdecea;
    color: #c62828;
}

.errors {
    background: #fdecea;
    color: #c62828;
    padding: 12px 16px;
    border-radius: 6px;
    margin-bottom: 20px;
    font-size: 14px;
    font-weight: 700;
}

.errors p {
    margin: 2px 0;
}

a {
    color: #2f5f9e;
    text-decoration: none;
    font-weight: 700;
}

a:hover {
    text-decoration: underline;
}

.login-page {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    margin: -30px;
    background: linear-gradient(135deg, #a8d5a0, #f5e6a3);
}

.login-card {
    background: #fff;
    padding: 40px;
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.15);
    width: 320px;
    text-align: center;
    border-top: 6px solid #6bbf59;
}

.login-card img.logo {
    width: 90px;
    margin-bottom: 15px;
}

.login-card h3 {
    margin-top: 0;
    margin-bottom: 25px;
    color: #3d8b3d;
    font-weight: 800;
}

.login-card input[type="text"],
.login-card input[type="password"] {
    width: 100%;
    margin-bottom: 15px;
}

.login-card button {
    width: 100%;
    padding: 10px;
    font-size: 15px;
}

.login-card .error {
    color: #c62828;
    background: #fdecea;
    padding: 8px;
    border-radius: 6px;
    margin-bottom: 15px;
    font-size: 14px;
    font-weight: 700;
}

.topbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
}

.topbar .welcome-text {
    font-weight: 700;
    color: #2f5233;
    margin-right: 10px;
}

.topbar .nav-link {
    background: #eef6ec;
    color: #2f5233;
    padding: 7px 14px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 700;
    text-decoration: none;
    transition: background 0.15s;
}

.topbar .nav-link:hover {
    background: #6bbf59;
    color: white;
    text-decoration: none;
}

.topbar .nav-link.logout-link {
    background: #fdecea;
    color: #c62828;
    margin-left: auto;
}

.topbar .nav-link.logout-link:hover {
    background: #c62828;
    color: white;
}

.page-title {
    color: #2f5233;
    font-size: 24px;
    font-weight: 800;
    margin: 0 0 20px 0;
}

.back-link {
    display: inline-block;
    margin-bottom: 20px;
    font-weight: 700;
}

.stat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 18px;
    margin-bottom: 25px;
}

.stat-card {
    padding: 22px;
    border-radius: 10px;
    color: white;
    box-shadow: 0 2px 10px rgba(0,0,0,0.08);
}

.stat-number {
    font-size: 30px;
    font-weight: 800;
}

.stat-label {
    font-size: 14px;
    font-weight: 600;
    margin-top: 4px;
}

.stat-blue { background: #2f5f9e; }
.stat-green { background: #4a9e4a; }
.stat-yellow { background: #d1a92e; }
.stat-red { background: #c0392b; }

.reset-form {
    display: flex;
    gap: 6px;
    margin: 0;
}

.reset-form input[type="password"] {
    width: 140px;
    padding: 7px 10px;
}

.reset-form button {
    padding: 7px 14px;
    margin-top: 0;
    font-size: 13px;
}

.success-msg {
    background: #eaf7ea;
    color: #2f7d32;
    padding: 12px 16px;
    border-radius: 6px;
    margin-bottom: 20px;
    font-size: 14px;
    font-weight: 700;
}

.info-text {
    color: #555;
    font-size: 14px;
    margin-bottom: 18px;
}

.signoff-field-table,
.signoff-field-table tr,
.signoff-field-table td {
    display: table !important;
}
.signoff-field-table tr {
    display: table-row !important;
}
.signoff-field-table td {
    display: table-cell !important;
}

@media (max-width: 768px) {
    body {
        padding: 15px;
    }

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

    .topbar .welcome-text {
        margin-right: 0;
        margin-bottom: 8px;
        text-align: center;
    }

    .topbar .nav-link {
        text-align: center;
    }

    .topbar .nav-link.logout-link {
        margin-left: 0;
    }

    .card {
        padding: 18px;
    }

    .form-grid {
        grid-template-columns: 1fr;
    }

    .search-bar {
        flex-direction: column;
        align-items: stretch;
    }

    .search-bar select,
    .search-bar button {
        width: 100%;
    }

    .stat-grid {
        grid-template-columns: 1fr 1fr;
    }

    table, thead, tbody, th, td, tr {
        display: block;
    }

    .table-wrap table tr {
        margin-bottom: 15px;
        border: 1px solid #eef0ee;
        border-radius: 8px;
        overflow: hidden;
    }

    .table-wrap table th {
        display: none;
    }

    .table-wrap table td {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 10px 14px;
        border-bottom: 1px solid #f2f2f2;
    }

    .table-wrap table td:before {
        content: attr(data-label);
        font-weight: 700;
        color: #555;
        margin-right: 10px;
    }

    .table-wrap table td:last-child {
        border-bottom: none;
    }

    .login-card {
        width: 90%;
        max-width: 320px;
    }
}

.chart-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 25px;
    margin-bottom: 25px;
}

.chart-container {
    position: relative;
    height: 280px;
    width: 100%;
}

.condition-badge {
    display: inline-block;
    padding: 4px 11px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 700;
    white-space: nowrap;
}

.condition-new { background: #e8f1fb; color: #2f5f9e; }
.condition-good { background: #eaf7ea; color: #2f7d32; }
.condition-fair { background: #fdf6e3; color: #a8790f; }
.condition-damaged { background: #fdecea; color: #c62828; }
.condition-repair { background: #fdf0e3; color: #b35c00; }
.condition-lost { background: #f5e0e0; color: #8e2424; }
.condition-disposed { background: #eceff1; color: #546e7a; }

@media (max-width: 768px) {
    .chart-row {
        grid-template-columns: 1fr;
    }
}

@media print {
    .no-print {
        display: none !important;
    }
    body {
        padding: 0;
    }
    .report-table {
        font-size: 11px;
    }
}

.report-header {
    text-align: center;
    margin-bottom: 20px;
    padding-bottom: 12px;
    border-bottom: 2px solid #4a9e4a;
}
.report-header h2 {
    margin: 0 0 4px 0;
}
.report-header h3 {
    margin: 0 0 8px 0;
    color: #555;
}
.report-signoff {
    margin-top: 30px;
    padding-top: 16px;
    border-top: 1px solid #ccc;
    font-size: 14px;
}

@media (min-width: 769px) {
    .table-wrap table th:last-child,
    .table-wrap table td:last-child {
        position: sticky;
        right: 0;
        box-shadow: -2px 0 4px rgba(0,0,0,0.06);
    }

    .table-wrap table th:last-child {
        background-color: #2f5233;
    }

    .table-wrap table td:last-child {
        background-color: #fff;
    }
}

.login-split {
    display: flex;
    min-height: 100vh;
    margin: -30px;
}

.login-illustration {
    flex: 1;
    background: linear-gradient(135deg, #6bbf59, #1f4d23);
    color: white;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 50px;
}

.illustration-logo {
    width: 90px;
    height: 90px;
    border-radius: 16px;
    margin-bottom: 25px;
    background: white;
    padding: 8px;
}

.login-illustration h1 {
    font-size: 30px;
    font-weight: 800;
    margin: 0;
}

.login-illustration h2 {
    font-size: 30px;
    font-weight: 800;
    color: #ffd54f;
    margin: 6px 0 20px 0;
}

.login-illustration p {
    max-width: 420px;
    font-size: 15px;
    line-height: 1.6;
    opacity: 0.95;
}

.login-form-panel {
    flex: 1;
    background: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px;
}

.login-form-inner {
    width: 100%;
    max-width: 380px;
}

.login-form-inner h3 {
    font-size: 26px;
    font-weight: 800;
    color: #2f5233;
    margin: 0 0 6px 0;
}

.login-subtext {
    color: #666;
    font-size: 14px;
    margin: 0 0 25px 0;
}

.input-icon-field {
    position: relative;
    margin-bottom: 16px;
}

.input-icon-field svg {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    width: 18px;
    height: 18px;
    color: #8a8a8a;
    pointer-events: none;
}

.input-icon-field input {
    padding-left: 42px !important;
}

.toggle-password {
    position: absolute;
    right: 14px;
    top: 50%;
    transform: translateY(-50%);
    cursor: pointer;
}

.toggle-password svg {
    position: static;
    color: #8a8a8a;
}

.login-options {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 13px;
    margin: 4px 0 22px 0;
}

.remember-me {
    display: flex;
    align-items: center;
    gap: 6px;
    color: #444;
    font-weight: 600;
}

.remember-me input {
    width: auto;
}

.forgot-link {
    color: #2f5f9e;
    font-weight: 700;
    cursor: default;
}

.login-submit-btn {
    width: 100%;
    padding: 12px;
    font-size: 15px;
    letter-spacing: 0.5px;
}

.login-footer {
    text-align: center;
    color: #999;
    font-size: 12px;
    margin-top: 22px;
}

@media (max-width: 768px) {
    .login-split {
        flex-direction: column;
        margin: -15px;
    }

    .login-illustration {
        flex: none;
        padding: 30px 20px;
    }

    .login-illustration h1,
    .login-illustration h2 {
        font-size: 22px;
    }

    .login-form-panel {
        padding: 30px 20px;
    }
}

.app-shell {
    display: flex;
    min-height: 100vh;
    margin: -30px;
}

.sidebar {
    width: 230px;
    background: #1f3d23;
    color: #fff;
    display: flex;
    flex-direction: column;
    padding: 22px 0;
    flex-shrink: 0;
}

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 0 20px 20px 20px;
    border-bottom: 1px solid rgba(255,255,255,0.12);
    margin-bottom: 14px;
}

.sidebar-brand img {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    background: #fff;
}

.sidebar-brand span {
    font-weight: 800;
    font-size: 14px;
    line-height: 1.3;
}

.sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 0 12px;
    flex: 1;
}

.sidebar-nav a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    border-radius: 8px;
    color: rgba(255,255,255,0.85);
    font-weight: 600;
    font-size: 14px;
    text-decoration: none;
}

.sidebar-nav a svg {
    width: 17px;
    height: 17px;
    flex-shrink: 0;
}

.sidebar-nav a:hover {
    background: rgba(255,255,255,0.08);
    text-decoration: none;
}

.sidebar-nav a.active {
    background: #6bbf59;
    color: #fff;
}

.sidebar-nav .sidebar-logout {
    margin-top: 8px;
    border-top: 1px solid rgba(255,255,255,0.12);
    padding-top: 12px;
}

.main-content {
    flex: 1;
    padding: 26px 32px;
    background: #f6f8f6;
    min-width: 0;
}

.main-topbar {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 18px;
    margin-bottom: 22px;
}

.main-topbar .bell-icon {
    width: 20px;
    height: 20px;
    color: #666;
}

.user-chip {
    display: flex;
    align-items: center;
    gap: 10px;
}

.user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: #2f5233;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 14px;
}

.user-chip-text {
    display: flex;
    flex-direction: column;
    line-height: 1.25;
}

.user-chip-name {
    font-weight: 700;
    font-size: 14px;
    color: #222;
}

.user-chip-role {
    font-size: 12px;
    color: #888;
}

.page-subtitle {
    color: #666;
    font-size: 14px;
    margin: -14px 0 22px 0;
}

.stat-grid-v2 {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 18px;
    margin-bottom: 24px;
}

.stat-card-v2 {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 20px 22px;
}

.stat-card-v2-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 14px;
}

.stat-card-v2-label {
    font-size: 13px;
    font-weight: 700;
    color: #555;
}

.stat-card-v2-icon {
    width: 20px;
    height: 20px;
    color: #6bbf59;
}

.stat-card-v2-number {
    font-size: 30px;
    font-weight: 800;
    color: #1e1e1e;
    line-height: 1;
}

.stat-card-v2-sub {
    font-size: 12px;
    color: #888;
    margin-top: 6px;
}

@media (max-width: 768px) {
    .app-shell {
        flex-direction: column;
        margin: -15px;
    }

    .sidebar {
        width: 100%;
        flex-direction: row;
        overflow-x: auto;
        padding: 12px;
        align-items: center;
    }

    .sidebar-brand {
        border-bottom: none;
        border-right: 1px solid rgba(255,255,255,0.15);
        padding: 0 12px 0 0;
        margin-bottom: 0;
    }

    .sidebar-nav {
        flex-direction: row;
        padding: 0 0 0 12px;
    }

    .sidebar-nav .sidebar-logout {
        margin-top: 0;
        border-top: none;
        padding-top: 0;
    }

    .main-content {
        padding: 20px;
    }
}

.ticket-badge {
    display: inline-block;
    padding: 4px 11px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 700;
    white-space: nowrap;
}

.ticket-status-open { background: #e8f1fb; color: #2f5f9e; }
.ticket-status-progress { background: #fdf0e3; color: #b35c00; }
.ticket-status-resolved { background: #eaf7ea; color: #2f7d32; }
.ticket-status-closed { background: #eceff1; color: #546e7a; }

.ticket-priority-low { background: #eceff1; color: #546e7a; }
.ticket-priority-medium { background: #e8f1fb; color: #2f5f9e; }
.ticket-priority-high { background: #fdf0e3; color: #b35c00; }
.ticket-priority-urgent { background: #fdecea; color: #c62828; }

.ticket-category { background: #f3e8fd; color: #7c3aed; }

.comment-thread {
    margin-top: 10px;
}

.comment-item {
    background: #f6f8f6;
    border-radius: 8px;
    padding: 10px 14px;
    margin-bottom: 8px;
    font-size: 14px;
}

.comment-item .comment-meta {
    font-size: 12px;
    color: #888;
    font-weight: 700;
    margin-bottom: 3px;
}
