* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: Arial, Helvetica, sans-serif;
    background: #f4f6f8;
    color: #1f2937;
}

.topbar {
    min-height: 72px;
    background: #111827;
    color: white;
    padding: 14px 24px;

    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
}

.brand {
    font-size: 22px;
    font-weight: 700;
}

.subtitle {
    font-size: 12px;
    opacity: 0.7;
    margin-top: 3px;
}

.user-box {
    text-align: right;
    font-size: 14px;
}

.user-box small {
    display: block;
    opacity: 0.7;
    margin-bottom: 5px;
}

.logout-button {
    border: 0;
    background: transparent;
    color: #fff;
    cursor: pointer;
    padding: 0;
}

.page {
    max-width: 1200px;
    margin: auto;
    padding: 24px;
}

.welcome h1 {
    margin-bottom: 5px;
}

.welcome p {
    margin-top: 0;
    color: #6b7280;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 15px;
    margin: 24px 0;
}

.stat-card {
    background: white;
    border-radius: 10px;
    padding: 20px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.08);
}

.stat-card span {
    display: block;
    color: #6b7280;
    font-size: 13px;
    margin-bottom: 8px;
}

.stat-card strong {
    font-size: 30px;
}

.panel {
    background: white;
    border-radius: 10px;
    padding: 20px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.08);
}

.panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 15px;
}

.panel-header h2 {
    margin: 0;
}

.primary-button {
    border: 0;
    border-radius: 7px;
    background: #2563eb;
    color: white;
    padding: 11px 18px;
    font-weight: 600;
    cursor: pointer;
}

.primary-button:disabled {
    opacity: 0.55;
    cursor: not-allowed;
}

.ticket-list {
    margin-top: 20px;
}

.ticket-card {
    border-top: 1px solid #e5e7eb;
    padding: 16px 0;
}

.ticket-top {
    display: flex;
    justify-content: space-between;
    gap: 10px;
}

.status {
    font-size: 12px;
    background: #eef2ff;
    padding: 5px 9px;
    border-radius: 20px;
}

.customer-name {
    font-weight: 600;
    margin-top: 8px;
}

.ticket-description {
    color: #4b5563;
    margin: 4px 0 8px;
}

.ticket-card small {
    color: #9ca3af;
}

.empty-state {
    text-align: center;
    padding: 50px 20px;
    color: #6b7280;
}

.login-body {
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

.login-card {
    width: 100%;
    max-width: 410px;
    background: white;
    padding: 32px;
    border-radius: 12px;
    box-shadow: 0 6px 30px rgba(0,0,0,0.1);
}

.login-logo {
    text-align: center;
    margin-bottom: 28px;
}

.login-logo h1 {
    margin-bottom: 5px;
}

.login-logo p {
    margin-top: 0;
    color: #6b7280;
}

.login-card label {
    display: block;
    margin: 14px 0 6px;
    font-weight: 600;
}

.login-card input {
    width: 100%;
    padding: 12px;
    border: 1px solid #d1d5db;
    border-radius: 7px;
    font-size: 16px;
}

.login-card .primary-button {
    width: 100%;
    margin-top: 20px;
}

.error-box {
    background: #fee2e2;
    color: #991b1b;
    padding: 12px;
    border-radius: 7px;
    margin-bottom: 15px;
}

@media (max-width: 800px) {

    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .page {
        padding: 15px;
    }

    .topbar {
        padding: 12px 15px;
    }

    .brand {
        font-size: 18px;
    }
}

@media (max-width: 480px) {

    .stats-grid {
        grid-template-columns: 1fr 1fr;
        gap: 10px;
    }

    .stat-card {
        padding: 15px;
    }

    .stat-card strong {
        font-size: 25px;
    }

    .panel {
        padding: 15px;
    }

    .panel-header {
        align-items: flex-start;
        flex-direction: column;
    }
}

a.primary-button {
    display: inline-block;
    text-decoration: none;
}

.ticket-link {
    display: block;
    text-decoration: none;
    color: inherit;
}

.ticket-link:hover {
    background: #f9fafb;
}

.photo-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 15px;
    margin-top: 15px;
}

.photo-card {
    border: 1px solid #e5e7eb;
    border-radius: 9px;
    padding: 10px;
    background: #fff;
}

.evidence-photo {
    display: block;
    width: 100%;
    height: 160px;
    object-fit: cover;
    border-radius: 7px;
    margin-bottom: 10px;
}

.photo-card strong,
.photo-card small {
    display: block;
    margin-top: 6px;
}

.photo-card small {
    color: #6b7280;
}

/* Compact ticket photo evidence */
.photo-grid {
    display: grid !important;
    grid-template-columns: repeat(auto-fill, minmax(140px, 180px)) !important;
    gap: 12px !important;
    align-items: start;
    margin-top: 15px;
}

.photo-card {
    width: 100%;
    max-width: 180px;
    box-sizing: border-box;
    border: 1px solid #e5e7eb;
    border-radius: 9px;
    padding: 8px;
    background: #fff;
}

.photo-card a {
    display: block;
    width: 100%;
}

.photo-card .evidence-photo {
    display: block !important;
    width: 100% !important;
    max-width: 164px !important;
    height: 120px !important;
    object-fit: cover !important;
    border-radius: 7px;
    margin: 0 0 8px 0 !important;
}

.photo-card strong {
    font-size: 14px;
}

.photo-card small {
    font-size: 12px;
    color: #6b7280;
}

@media (max-width: 600px) {
    .photo-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    }

    .photo-card {
        max-width: none;
    }

    .photo-card .evidence-photo {
        max-width: none !important;
        height: 110px !important;
    }
}

/* Global navigation */
.topbar-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.dashboard-button {
    display: inline-block;
    padding: 8px 14px;
    border-radius: 7px;
    text-decoration: none;
    font-weight: 600;
    background: #ffffff;
    color: #111827;
    border: 1px solid #d1d5db;
}

.dashboard-button:hover {
    background: #f3f4f6;
}

@media (max-width: 600px) {
    .topbar-actions {
        gap: 7px;
    }

    .dashboard-button {
        padding: 7px 10px;
        font-size: 13px;
    }
}

/* Dashboard button - high visibility */
.dashboard-button {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    background: #ffffff !important;
    color: #111827 !important;
    border: 1px solid #d1d5db !important;
    border-radius: 8px !important;
    padding: 9px 16px !important;
    font-weight: 700 !important;
    text-decoration: none !important;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15);
}

.dashboard-button:hover,
.dashboard-button:focus {
    background: #f3f4f6 !important;
    color: #111827 !important;
}

@media (max-width: 600px) {
    .dashboard-button {
        padding: 8px 12px !important;
        font-size: 13px !important;
    }
}

/* Role-specific dashboard */
.dashboard-section {
    margin-top: 22px;
}

.ticket-meta {
    margin-top: 5px;
    font-size: 13px;
    line-height: 1.4;
    color: #4b5563;
}

.dashboard-section .ticket-card {
    transition: transform 0.1s ease, box-shadow 0.1s ease;
}

.dashboard-section .ticket-card:active {
    transform: scale(0.99);
}

@media (max-width: 600px) {
    .dashboard-section {
        margin-top: 16px;
    }

    .dashboard-section .panel-header {
        align-items: flex-start;
    }

    .ticket-meta {
        font-size: 12px;
    }
}

/* Stronger ticket/task visual hierarchy */

.ticket-card .ticket-top > strong {
    font-weight: 800 !important;
    color: #111827 !important;
    font-size: 15px;
}

.ticket-card .customer-name {
    color: #374151 !important;
    font-weight: 600 !important;
    margin-top: 7px;
}

.ticket-card .ticket-description {
    color: #111827 !important;
    font-size: 16px !important;
    font-weight: 800 !important;
    line-height: 1.35;
    margin-top: 7px;
    margin-bottom: 7px;
}

.ticket-card .ticket-meta {
    color: #4b5563 !important;
    font-weight: 500;
}

.ticket-card small {
    color: #6b7280 !important;
}

.ticket-card.ticket-link {
    color: inherit !important;
    text-decoration: none !important;
}

.ticket-card.ticket-link:hover,
.ticket-card.ticket-link:focus {
    text-decoration: none !important;
}

/* Make status stand apart from the task itself */
.ticket-card .status {
    font-weight: 700 !important;
    white-space: nowrap;
}

@media (max-width: 600px) {
    .ticket-card .ticket-description {
        font-size: 15px !important;
    }

    .ticket-card .customer-name {
        font-size: 14px;
    }
}

/* Task priority colours */

.ticket-description.priority-normal {
    color: #d97706 !important;
    font-weight: 800 !important;
}

.ticket-description.priority-high {
    color: #dc2626 !important;
    font-weight: 800 !important;
}

.ticket-description.priority-urgent {
    color: #b91c1c !important;
    font-weight: 900 !important;
}

.ticket-description.priority-low {
    color: #374151 !important;
    font-weight: 700 !important;
}

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

@media (max-width: 600px) {
    .management-actions {
        width: 100%;
        margin-top: 10px;
    }

    .management-actions .primary-button,
    .management-actions .dashboard-button {
        flex: 1 1 auto;
        text-align: center;
    }
}

/* Clickable dashboard counters */
.stat-link {
    text-decoration: none !important;
    color: inherit !important;
    cursor: pointer;
    transition: transform 0.1s ease, box-shadow 0.1s ease;
}

.stat-link:hover,
.stat-link:focus {
    text-decoration: none !important;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.12);
}

.stat-link:active {
    transform: scale(0.97);
}

/* Ticket search */
.ticket-search {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 18px 0;
}

.ticket-search input {
    flex: 1;
    min-width: 0;
}

.search-summary {
    margin: 8px 0 16px;
    color: #4b5563;
}

@media (max-width: 600px) {
    .ticket-search {
        flex-wrap: wrap;
    }

    .ticket-search input {
        flex: 1 1 100%;
        width: 100%;
    }
}

.brand-area {
    display: flex;
    align-items: center;
    gap: 14px;
    min-width: 0;
}

.company-logo {
    display: block;
    width: auto;
    height: 52px;
    max-width: 220px;
    object-fit: contain;
    flex-shrink: 0;
}

.brand-text {
    min-width: 0;
}

@media (max-width: 700px) {
    .topbar {
        padding: 12px 16px;
        gap: 12px;
    }

    .brand-area {
        gap: 10px;
    }

    .company-logo {
        height: 40px;
        max-width: 155px;
    }

    .brand {
        font-size: 18px;
    }

    .subtitle {
        font-size: 11px;
    }
}

@media (max-width: 520px) {
    .company-logo {
        height: 34px;
        max-width: 125px;
    }

    .brand-text {
        display: none;
    }
}

/* =========================================================
   DARNOV TECHNOLOGY STAFF LOGIN
   ========================================================= */

.staff-login-page {
    margin: 0;
    min-height: 100vh;
    font-family: Arial, Helvetica, sans-serif;
    background:
        radial-gradient(circle at 12% 18%, rgba(41, 128, 185, 0.10), transparent 28%),
        radial-gradient(circle at 88% 78%, rgba(52, 152, 219, 0.10), transparent 30%),
        linear-gradient(135deg, #f8fbff 0%, #eef6fc 52%, #f9fcff 100%);
    color: #1f2d3d;
}

.staff-login-shell {
    min-height: 100vh;
    display: grid;
    grid-template-columns: minmax(220px, 1fr) minmax(360px, 520px) minmax(220px, 1fr);
    align-items: center;
    gap: 36px;
    padding: 48px 56px;
    box-sizing: border-box;
    position: relative;
    overflow: hidden;
}

.staff-login-shell::before,
.staff-login-shell::after {
    content: "";
    position: absolute;
    width: 640px;
    height: 640px;
    border-radius: 50%;
    border: 1px solid rgba(31, 120, 180, 0.10);
    pointer-events: none;
}

.staff-login-shell::before {
    left: -360px;
    bottom: -390px;
}

.staff-login-shell::after {
    right: -360px;
    top: -390px;
}

.staff-login-main {
    width: 100%;
    z-index: 2;
}

.staff-login-card {
    width: 100%;
    background: rgba(255, 255, 255, 0.96);
    border-radius: 22px;
    padding: 38px 42px 30px;
    box-sizing: border-box;
    box-shadow: 0 24px 60px rgba(34, 77, 112, 0.16);
    border: 1px solid rgba(47, 117, 169, 0.10);
    text-align: center;
}

.staff-login-logo-wrap {
    display: flex;
    justify-content: center;
    margin-bottom: 18px;
}

.staff-login-logo {
    display: block;
    width: min(310px, 88%);
    height: auto;
    object-fit: contain;
}

.staff-login-card h1 {
    margin: 6px 0 8px;
    font-size: 30px;
    line-height: 1.2;
    color: #123b5d;
}

.staff-login-intro {
    margin: 0 auto 24px;
    max-width: 390px;
    color: #607386;
    font-size: 15px;
    line-height: 1.6;
}

.staff-login-form {
    text-align: left;
}

.staff-form-group {
    margin-bottom: 18px;
}

.staff-form-group label {
    display: block;
    margin-bottom: 7px;
    color: #25394b;
    font-size: 14px;
    font-weight: 600;
}

.staff-form-group input {
    width: 100%;
    min-height: 48px;
    border: 1px solid #c9d6e2;
    border-radius: 10px;
    box-sizing: border-box;
    padding: 11px 14px;
    background: #ffffff;
    color: #172736;
    font-size: 16px;
    outline: none;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.staff-form-group input:focus {
    border-color: #2378b5;
    box-shadow: 0 0 0 3px rgba(35, 120, 181, 0.12);
}

.staff-login-button {
    width: 100%;
    min-height: 48px;
    border: 0;
    border-radius: 10px;
    background: linear-gradient(135deg, #1e73b5, #2b91d1);
    color: #ffffff;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.staff-login-button:hover {
    box-shadow: 0 8px 20px rgba(30, 115, 181, 0.24);
}

.staff-login-button:active {
    transform: translateY(1px);
}

.staff-forgot-password {
    margin-top: 15px;
    text-align: center;
}

.staff-forgot-password a {
    color: #2476ad;
    font-size: 14px;
    text-decoration: none;
}

.staff-forgot-password a:hover {
    text-decoration: underline;
}

.staff-login-copyright {
    margin-top: 28px;
    padding-top: 20px;
    border-top: 1px solid #e7edf3;
    color: #6c7a86;
    font-size: 12px;
    line-height: 1.5;
}

.staff-login-values {
    margin-top: 7px;
    color: #2e729f;
    font-size: 12px;
    font-weight: 600;
}

.login-side {
    z-index: 1;
    display: flex;
    align-items: center;
}

.login-side-left {
    justify-content: flex-end;
    text-align: right;
}

.login-side-right {
    justify-content: flex-start;
    text-align: left;
}

.login-side-content {
    max-width: 330px;
}

.login-side-content h2 {
    margin: 0 0 12px;
    color: #164e76;
    font-size: clamp(26px, 2.3vw, 40px);
    line-height: 1.15;
}

.login-side-content p {
    margin: 0;
    color: #6b7d8d;
    font-size: 15px;
    line-height: 1.7;
}

.staff-login-page .error-box {
    margin: 0 0 18px;
    padding: 12px 14px;
    border-radius: 9px;
    background: #fff2f2;
    border: 1px solid #f0c5c5;
    color: #9b2c2c;
    font-size: 14px;
    text-align: left;
}

/* Tablet */
@media (max-width: 1100px) {
    .staff-login-shell {
        grid-template-columns: 1fr minmax(340px, 500px) 1fr;
        gap: 24px;
        padding: 40px 28px;
    }

    .login-side-content h2 {
        font-size: 25px;
    }

    .login-side-content p {
        font-size: 14px;
    }
}

/* Small tablet */
@media (max-width: 850px) {
    .staff-login-shell {
        grid-template-columns: 1fr;
        padding: 34px 22px;
    }

    .staff-login-main {
        max-width: 560px;
        margin: 0 auto;
    }

    .login-side {
        display: none;
    }

    .staff-login-card {
        padding: 34px 34px 28px;
    }
}

/* Mobile */
@media (max-width: 520px) {
    .staff-login-shell {
        min-height: 100svh;
        padding: 20px 14px;
    }

    .staff-login-card {
        border-radius: 16px;
        padding: 28px 20px 22px;
    }

    .staff-login-logo {
        width: min(280px, 92%);
    }

    .staff-login-card h1 {
        font-size: 26px;
    }

    .staff-login-intro {
        font-size: 14px;
    }

    .staff-login-copyright {
        margin-top: 24px;
    }
}


/* =========================================================
   Form Controls
   ========================================================= */

.form-group {
    margin-bottom: 18px;
}

.form-group label {
    display: block;
    margin-bottom: 7px;
    font-weight: 700;
    color: #1f2937;
}

.form-control,
.form-group input[type="text"],
.form-group input[type="search"],
.form-group input[type="number"],
.form-group input[type="tel"],
.form-group input[type="email"],
.form-group textarea,
.form-group select {
    width: 100%;
    box-sizing: border-box;
    padding: 12px 14px;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    background: #ffffff;
    font: inherit;
    color: #111827;
    transition:
        border-color 0.2s ease,
        box-shadow 0.2s ease;
}

.form-control:focus,
.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

.form-group textarea {
    resize: vertical;
    min-height: 90px;
}

.form-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 24px;
}

.installation-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0 20px;
}

.installation-grid .full-width {
    grid-column: 1 / -1;
}

@media (max-width: 700px) {
    .installation-grid {
        grid-template-columns: 1fr;
    }

    .installation-grid .full-width {
        grid-column: auto;
    }
}

/* =========================================================
   Reusable Darnov Form Grid
   ========================================================= */

.form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0 20px;
}

.form-grid .full-width {
    grid-column: 1 / -1;
}

/*
 * Keep two columns on tablets / smaller desktop windows.
 * Collapse only on genuinely narrow mobile screens.
 */
@media (max-width: 520px) {
    .form-grid {
        grid-template-columns: 1fr;
    }

    .form-grid .full-width {
        grid-column: auto;
    }
}

/* Override the older installation-specific mobile breakpoint */
@media (min-width: 521px) {
    .installation-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    }
}
