html, body {
    margin: 0;
    padding: 0;
    min-height: 100vh;
    background: #d7d7d7;
    font-family: 'Inter', sans-serif;
}

* {
    box-sizing: border-box;
}

/* PHONE SHELL */

.mobile-shell {
    width: 100%;
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    background: #dcdcdc;
}

/* APP BODY */

.mobile-app {
    width: 100%;
    max-width: 430px;
    min-height: 100vh;
    background: #f5f5f3;
    position: relative;
    display: flex;
    flex-direction: column;
}

@media (min-width: 431px) {
    .mobile-shell {
        align-items: center;
        justify-content: center;
        padding: 40px 16px;
    }

    .mobile-app {
        width: 375px;
        height: 812px;
        min-height: 0;
        border-radius: 32px;
        overflow: hidden;
        box-shadow: 0 20px 60px rgba(0,0,0,0.18);
        /* Establishes a containing block so position:fixed children
           (drawer, backdrop, fab) stay inside this phone-mockup card
           instead of the full browser viewport. */
        transform: translateZ(0);
    }
}

/* TOPBAR */

.topbar {
    min-height: 58px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 18px;
    background: #f5f5f3;
    border-bottom: 1px solid #e9e9e9;
    position: sticky;
    top: 0;
    z-index: 10;
}

.topbar-title {
    font-size: 21px;
    font-weight: 700;
    color: #1d1d1d;
}

.icon-button {
    border: none;
    background: transparent;
    font-size: 22px;
    line-height: 1;
    padding: 6px;
    cursor: pointer;
    color: #1d1d1d;
}

/* APP CONTENT */

.app-content {
    flex: 1;
    overflow-y: auto;
    padding: 18px;
}

@media (max-width: 380px) {
    .app-content {
        padding: 14px;
    }
}

/* DRAWER */

.drawer {
    position: fixed;
    top: 0;
    left: -260px;
    width: 240px;
    max-width: 80vw;
    height: 100vh;
    background: white;
    z-index: 1000;
    transition: left 0.25s ease;
    padding-top: 100px;
    overflow-y: auto;
    box-shadow: 0 0 30px rgba(0,0,0,0.12);
}

.drawer.open {
        left: 0;
    }

.drawer a {
        display: block;
        padding: 18px 28px;
        text-decoration: none;
        color: #222;
        font-size: 18px;
        font-weight: 500;
    }

.drawer a.active {
            background: #f1f1ee;
        }

/* BACKDROP */

.backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.2);
    z-index: 900;
}

/* PAGE */

.projects-page {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* HEADER */

.page-header {
    margin-bottom: 10px;
}

.page-subtitle {
    color: #8c8c8c;
    font-size: 14px;
}

.page-title {
    margin: 4px 0 0 0;
    font-size: 26px;
    font-weight: 700;
    color: #1d1d1d;
}

/* LIST */

.project-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

/* LINK */

.project-card-link {
    text-decoration: none;
    color: inherit;
}

/* CARD */

.project-card {
    background: white;
    border-radius: 28px;
    padding: 22px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: 0 2px 8px rgba(0,0,0,0.03), 0 12px 24px rgba(0,0,0,0.04);
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.project-card:active {
        transform: scale(0.98);
    }

/* LEFT */

.project-left {
    display: flex;
    align-items: center;
    gap: 18px;
}

/* ICON */

.project-icon {
    width: 58px;
    height: 58px;
    border-radius: 18px;
    background: #f1f1ef;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 26px;
}

/* META */

.project-meta {
    font-size: 12px;
    color: #8b8b8b;
}

/* TITLE */

.project-title {
    font-size: 18px;
    font-weight: 700;
    margin-top: 4px;
    color: #1f1f1f;
}

/* ADDRESS */

.project-address {
    margin-top: 4px;
    font-size: 13px;
    color: #7b7b7b;
}

/* RIGHT */

.project-right {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 12px;
}

/* BADGE */

.status-badge {
    border-radius: 999px;
    padding: 8px 14px;
    font-size: 12px;
    font-weight: 600;
}

.status-badge.active {
        background: #dff5e2;
        color: #257942;
    }

.status-badge.inactive {
        background: #efefef;
        color: #777;
    }

/* DELETE */

.delete-button {
    border: none;
    background: transparent;
    font-size: 20px;
    cursor: pointer;
}

/* FAB */

.fab {
    position: fixed;
    right: 28px;
    bottom: 28px;
    width: 68px;
    height: 68px;
    border-radius: 50%;
    background: #22331f;
    color: white;
    text-decoration: none;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 38px;
    box-shadow: 0 12px 24px rgba(0,0,0,0.18);
}

/* STATES */

.loading-state,
.empty-state {
    background: white;
    border-radius: 24px;
    padding: 24px;
    text-align: center;
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}

/* Project Details Page */

.project-details-page {
    padding: 20px;
    max-width: 800px;
    margin: 0 auto;
}

.details-header {
    margin-bottom: 24px;
}

.back-button {
    background: none;
    border: none;
    font-size: 16px;
    color: #666;
    cursor: pointer;
    padding: 8px 0;
    margin-bottom: 16px;
}

.back-button:hover {
        color: #22331f;
    }

/* Info Card */

.info-card {
    background: white;
    border-radius: 24px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}

.card-header {
    display: flex;
    gap: 16px;
    margin-bottom: 20px;
}

.project-icon-large {
    width: 64px;
    height: 64px;
    border-radius: 20px;
    background: #f1f1ef;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 32px;
}

.project-name {
    margin: 8px 0 8px 0;
    font-size: 20px;
}

.info-row {
    display: flex;
    padding: 8px 0;
    border-bottom: 1px solid #eee;
}

.info-label {
    width: 100px;
    font-weight: 600;
    color: #666;
}

.info-value {
    flex: 1;
    color: #222;
}

/* Stats Grid */

.stats-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    margin-bottom: 24px;
}

.stat-card {
    background: white;
    border-radius: 20px;
    padding: 16px;
    text-align: center;
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}

.stat-icon {
    font-size: 28px;
    margin-bottom: 8px;
}

.stat-value {
    font-size: 28px;
    font-weight: 700;
    color: #22331f;
}

.stat-label {
    font-size: 12px;
    color: #888;
    margin-top: 4px;
}

/* Sections */

.activities-section,
.materials-section,
.workers-section {
    background: white;
    border-radius: 24px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.section-header h3 {
        margin: 0;
    }

/* Activity List */

.activity-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.activity-item {
    padding: 12px;
    background: #f9f9f7;
    border-radius: 16px;
}

.activity-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
}

.activity-id {
    font-weight: 600;
    color: #22331f;
}

.activity-hours {
    color: #666;
    font-size: 14px;
}

.activity-details {
    display: flex;
    gap: 16px;
    font-size: 13px;
    color: #888;
    flex-wrap: wrap;
}

.material-badge {
    background: #e8f0e6;
    padding: 2px 8px;
    border-radius: 12px;
    color: #22331f;
}

/* Materials List */

.materials-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.material-item {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid #f0f0f0;
}

.material-name {
    font-weight: 500;
}

.material-quantity {
    color: #666;
}

/* Worker List */

.worker-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.worker-item {
    width: 100%;
}

.worker-info {
    display: flex;
    justify-content: space-between;
    margin-bottom: 4px;
    font-size: 14px;
}

.worker-name {
    font-weight: 500;
}

.worker-hours {
    color: #666;
}

.worker-bar {
    height: 6px;
    background: #f0f0f0;
    border-radius: 3px;
    overflow: hidden;
}

.worker-bar-fill {
    height: 100%;
    background: #22331f;
    border-radius: 3px;
}

/* Buttons */

.btn-primary {
    background: #22331f;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 12px;
    cursor: pointer;
    font-size: 14px;
}

.btn-primary.small {
        padding: 6px 12px;
        font-size: 12px;
    }

.btn-secondary {
    background: #f0f0f0;
    color: #333;
    border: none;
    padding: 8px 16px;
    border-radius: 12px;
    cursor: pointer;
}

.btn-link {
    background: none;
    border: none;
    color: #22331f;
    cursor: pointer;
    text-decoration: underline;
}

/* Empty States */

.empty-activities,
.empty-materials {
    text-align: center;
    padding: 32px;
    color: #888;
}

.more-activities,
.more-materials {
    text-align: center;
    margin-top: 12px;
    padding-top: 8px;
}

.error-state {
    text-align: center;
    padding: 40px;
    background: white;
    border-radius: 24px;
}

/* CUSTOMERS PAGE */

.customers-page {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* CUSTOMER FORM PAGE */

.customer-form-page {
    padding: 20px;
    max-width: 800px;
    margin: 0 auto;
}

/* FORM CARD */

.form-card {
    background: white;
    border-radius: 24px;
    padding: 24px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}

/* FORM GROUP */

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

.form-label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: #333;
    font-size: 14px;
}

.form-input {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid #e0e0e0;
    border-radius: 12px;
    font-size: 16px;
    font-family: inherit;
    transition: border-color 0.2s ease;
}

.form-input:focus {
        outline: none;
        border-color: #22331f;
    }

.form-input.invalid {
        border-color: #d32f2f;
    }

/* VALIDATION */

.validation-summary {
    background: #fee;
    border: 1px solid #fcc;
    border-radius: 12px;
    padding: 12px;
    margin-bottom: 20px;
    color: #d32f2f;
    font-size: 14px;
}

.validation-message {
    color: #d32f2f;
    font-size: 12px;
    margin-top: 4px;
    display: block;
}

/* FORM ACTIONS */

.form-actions {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid #f0f0f0;
}

/* CUSTOMER LIST */

.customer-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

/* CUSTOMER CARD LINK */

.customer-card-link {
    text-decoration: none;
    color: inherit;
}

/* CUSTOMER CARD */

.customer-card {
    background: white;
    border-radius: 28px;
    padding: 22px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: 0 2px 8px rgba(0,0,0,0.03), 0 12px 24px rgba(0,0,0,0.04);
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.customer-card:active {
        transform: scale(0.98);
    }

/* CUSTOMER CARD LEFT */

.customer-left {
    display: flex;
    align-items: center;
    gap: 18px;
    flex: 1;
}

/* CUSTOMER ICON */

.customer-icon {
    width: 58px;
    height: 58px;
    border-radius: 18px;
    background: #f1f1ef;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 26px;
}

/* CUSTOMER ICON LARGE */

.customer-icon-large {
    width: 64px;
    height: 64px;
    border-radius: 20px;
    background: #f1f1ef;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 32px;
}

/* CUSTOMER META */

.customer-meta {
    font-size: 12px;
    color: #8b8b8b;
}

/* CUSTOMER NAME */

.customer-name {
    font-size: 18px;
    font-weight: 700;
    margin-top: 4px;
    color: #1f1f1f;
}

/* CUSTOMER CONTACT */

.customer-contact {
    margin-top: 6px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    font-size: 12px;
    color: #7b7b7b;
}

.customer-contact span {
        display: flex;
        align-items: center;
        gap: 6px;
    }

/* CUSTOMER CARD RIGHT */

.customer-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

/* CUSTOMER DETAILS PAGE */

.customer-details-page {
    padding: 20px;
    max-width: 800px;
    margin: 0 auto;
}

/* PROJECTS SECTION */

.projects-section {
    background: white;
    border-radius: 24px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}

/* PROJECT LIST MINI */

.project-list-mini {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* PROJECT MINI CARD */

.project-mini-card {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px;
    background: #f9f9f7;
    border-radius: 16px;
    text-decoration: none;
    transition: background 0.2s ease;
}

.project-mini-card:hover {
        background: #f0f0ee;
    }

.project-mini-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.project-mini-id {
    font-weight: 600;
    color: #22331f;
    font-size: 14px;
}

.project-mini-address {
    font-size: 12px;
    color: #888;
}

.project-mini-status .status-badge {
    padding: 4px 10px;
    font-size: 11px;
}

/* EMPTY PROJECTS */

.empty-projects {
    text-align: center;
    padding: 32px;
    color: #888;
}

/* MORE PROJECTS */

.more-projects {
    text-align: center;
    margin-top: 12px;
    padding-top: 8px;
}

/* ACTION BUTTONS */

.action-buttons {
    display: flex;
    gap: 12px;
    margin-top: 20px;
}

.btn-danger {
    background: #dc3545;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 12px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: background 0.2s ease;
}

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

/* LOGIN PAGE */

.login-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background: #d7d7d7;
}

.login-shell {
    width: 100%;
    max-width: 400px;
    padding: 20px;
}

.login-card {
    background: white;
    border-radius: 28px;
    padding: 28px 24px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.12);
}

.login-header {
    text-align: center;
    margin-bottom: 32px;
}

.login-subtitle {
    color: #8c8c8c;
    font-size: 14px;
    letter-spacing: 0.5px;
}

.login-title {
    font-size: 26px;
    font-weight: 700;
    color: #1d1d1d;
    margin: 8px 0 0 0;
}

.login-btn {
    width: 100%;
    padding: 14px;
    font-size: 16px;
    font-weight: 600;
    border-radius: 16px;
    margin-top: 8px;
}

.login-footer {
    text-align: center;
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid #f0f0f0;
    font-size: 14px;
    color: #666;
}

.register-link {
    color: #22331f;
    text-decoration: none;
    font-weight: 600;
    margin-left: 5px;
}

.register-link:hover {
        text-decoration: underline;
    }

.success-message {
    background: #dff5e2;
    color: #257942;
    border-radius: 12px;
    padding: 12px;
    margin-top: 16px;
    text-align: center;
    font-size: 14px;
}

.error-message {
    background: #fee;
    color: #d32f2f;
    border-radius: 12px;
    padding: 12px;
    margin-top: 16px;
    text-align: center;
    font-size: 14px;
}

/* DRAWER DIVIDER */

.drawer-divider {
    margin: 12px 20px;
    border: none;
    border-top: 1px solid #e9e9e9;
}

/* DRAWER LOGOUT LINK */

.drawer-logout {
    display: block;
    padding: 14px 28px;
    text-decoration: none;
    color: #dc3545;
    font-size: 18px;
    font-weight: 500;
    transition: background 0.2s ease;
}

.drawer-logout:hover {
        background: #fef0f0;
    }

/* HOME PAGE - LANDING PAGE */

.home-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100%;
    background: #d7d7d7;
    flex: 1;
}

.home-shell {
    width: 100%;
    max-width: 400px;
    padding: 20px;
}

.home-card {
    background: white;
    border-radius: 28px;
    padding: 32px 24px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.12);
}

/* WELCOME SECTION (LOGGET IND) */

.welcome-section {
    text-align: center;
}

.welcome-icon {
    font-size: 48px;
    margin-bottom: 14px;
}

.welcome-title {
    font-size: 22px;
    font-weight: 700;
    color: #1d1d1d;
    margin: 0 0 8px 0;
}

.welcome-text {
    color: #666;
    font-size: 16px;
    margin-bottom: 32px;
}

.quick-actions {
    text-align: left;
    margin-top: 24px;
}

.quick-actions h3 {
        font-size: 16px;
        color: #888;
        margin-bottom: 16px;
    }

.action-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(84px, 1fr));
    gap: 10px;
    margin-bottom: 28px;
}

.action-card {
    background: #f5f5f3;
    border-radius: 20px;
    padding: 16px 12px;
    text-align: center;
    text-decoration: none;
    transition: transform 0.2s ease, background 0.2s ease;
}

.action-card:hover {
        background: #ecece8;
        transform: translateY(-2px);
    }

.action-icon {
    font-size: 28px;
    margin-bottom: 8px;
}

.action-card span {
    display: block;
    font-size: 13px;
    color: #333;
    font-weight: 500;
}

.logout-btn {
    background: #f0f0f0;
    color: #dc3545;
    border: none;
    padding: 12px 24px;
    border-radius: 16px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    width: 100%;
    margin-top: 16px;
    transition: background 0.2s ease;
}

.logout-btn:hover {
        background: #fee;
    }

/* GUEST SECTION (IKKE LOGGET IND) */

.guest-section {
    text-align: center;
}

.logo-icon {
    font-size: 52px;
    margin-bottom: 14px;
}

.guest-title {
    font-size: 28px;
    font-weight: 700;
    color: #1d1d1d;
    margin: 0 0 8px 0;
}

.guest-text {
    color: #888;
    font-size: 16px;
    margin-bottom: 32px;
}

.auth-buttons {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 32px;
}

.btn-login {
    background: #22331f;
    color: white;
    border: none;
    padding: 14px 24px;
    border-radius: 16px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    width: 100%;
    transition: background 0.2s ease;
}

.btn-login:hover {
        background: #2e4429;
    }

.btn-register {
    background: #f0f0f0;
    color: #333;
    border: none;
    padding: 14px 24px;
    border-radius: 16px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    width: 100%;
    transition: background 0.2s ease;
}

.btn-register:hover {
        background: #e5e5e5;
    }

.features {
    display: flex;
    flex-direction: column;
    gap: 12px;
    text-align: left;
    background: #f8f8f6;
    border-radius: 20px;
    padding: 20px;
}

.feature {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 14px;
    color: #444;
}

.feature span:first-child {
        font-size: 20px;
        width: 32px;
    }

/* AUTH (login / register / current user) */

.auth-content {
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.auth-card {
    background: white;
    border-radius: 24px;
    padding: 24px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}

.auth-card .btn-primary,
    .auth-card .btn-secondary {
        width: 100%;
        margin-top: 8px;
    }

.current-user {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    color: #666;
    white-space: nowrap;
}

.logout-button {
    background: none;
    border: none;
    font-size: 12px;
    color: #22331f;
    text-decoration: underline;
    cursor: pointer;
    padding: 0;
}
