* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: Arial, sans-serif;
    background: #f3f4f6;
    color: #1f2937;
}

.topbar {
    height: 70px;
    background: #111827;
    color: white;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
}

.logo {
    font-size: 30px;
    font-weight: bold;
}

.logo span {
    color: #e38b29;
}

.topbar-right {
    display: flex;
    gap: 12px;
}

.topbar button {
    height: 44px;
    padding: 0 18px;
    border: none;
    border-radius: 8px;
    background: #374151;
    color: white;
    font-size: 16px;
    cursor: pointer;
}

.topbar button:hover {
    background: #e38b29;
}

.layout {
    display: grid;
    grid-template-columns: 1fr 360px;
    gap: 18px;
    padding: 18px;
    height: calc(100vh - 70px);
}

.calendar-area {
    background: white;
    border-radius: 14px;
    padding: 18px;
    overflow: auto;
    box-shadow: 0 4px 14px rgba(0,0,0,0.08);
}

.calendar-area h1 {
    margin-top: 0;
}

.calendar-wrapper {
    display: grid;
    grid-template-columns: 90px 1fr;
    border-top: 1px solid #d1d5db;
    position: relative;
}

.time-column {
    position: relative;
    border-right: 1px solid #d1d5db;
    background: #f9fafb;
}

.time-marker {
    position: absolute;
    left: 0;
    width: 100%;
    transform: translateY(-10px);
    padding: 0 10px;
    font-weight: bold;
    color: #6b7280;
    font-size: 15px;
}

.calendar-day {
    position: relative;
    background: white;
}

.hour-line {
    position: absolute;
    left: 0;
    right: 0;
    border-top: 1px solid #e5e7eb;
}

.order-card {
    position: absolute;
    left: 14px;
    right: 14px;
    background: #e38b29;
    color: white;
    padding: 12px 16px;
    border-radius: 12px;
    font-size: 18px;
    cursor: pointer;
    box-shadow: 0 3px 8px rgba(0,0,0,0.18);
    overflow: hidden;
}

.order-card small {
    opacity: 0.9;
}

.order-card.drop-hover {
    outline: 4px solid #111827;
    outline-offset: 2px;
}

.sidebar {
    display: flex;
    flex-direction: column;
    gap: 14px;
    overflow: auto;
}

.resource-box {
    background: white;
    border-radius: 14px;
    padding: 14px;
    box-shadow: 0 4px 14px rgba(0,0,0,0.08);
}

.resource-box h2 {
    margin: 0 0 10px;
    font-size: 20px;
}

.resource-card,
.absence-card {
    min-height: 48px;
    padding: 12px;
    margin-bottom: 8px;
    border-radius: 10px;
    font-size: 17px;
    font-weight: bold;
    cursor: grab;
    touch-action: none;
    user-select: none;
}

.employee {
    background: #dbeafe;
}

.vehicle {
    background: #dcfce7;
}

.team {
    background: #fef3c7;
}

.absence-card {
    background: #fee2e2;
    cursor: default;
}

.drag-ghost {
    position: fixed;
    z-index: 9999;
    pointer-events: none;
    opacity: 0.88;
    min-width: 220px;
    transform: scale(1.05);
    box-shadow: 0 8px 22px rgba(0,0,0,0.25);
}

.assignments {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 10px;
}

.assignment-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 10px;
    border-radius: 999px;
    font-size: 13px;
    font-weight: bold;
    color: #111827;
    background: rgba(255,255,255,0.85);
    cursor: grab;
    touch-action: none;
    user-select: none;
}

.assignment-badge.employee {
    background: #bfdbfe;
}

.assignment-badge.vehicle {
    background: #bbf7d0;
}

.assignment-badge.team {
    background: #fde68a;
}

.assignment-remove-zone {
    position: fixed;
    left: 50%;
    bottom: 88px;
    transform: translateX(-50%);
    background: #991b1b;
    color: white;
    padding: 18px 34px;
    border-radius: 999px;
    font-size: 18px;
    font-weight: bold;
    z-index: 9998;
    opacity: 0;
    pointer-events: auto;
    transition: 0.2s ease;
}

.assignment-remove-zone.show {
    opacity: 1;
}

.assignment-remove-zone.hover {
    background: #dc2626;
    transform: translateX(-50%) scale(1.06);
}

.notice {
    position: fixed;
    left: 50%;
    bottom: 28px;
    transform: translateX(-50%) translateY(20px);
    background: #111827;
    color: white;
    padding: 14px 24px;
    border-radius: 999px;
    font-size: 17px;
    opacity: 0;
    pointer-events: none;
    transition: 0.2s ease;
    z-index: 10000;
}

.notice.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}
.order-card {
    touch-action: none;
    user-select: none;
}

.order-card.order-moving {
    opacity: 0.85;
    z-index: 50;
    transform: scale(1.01);
}

.order-resize-handle {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 26px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: ns-resize;
    background: rgba(0,0,0,0.16);
    border-radius: 0 0 12px 12px;
    touch-action: none;
    user-select: none;
}

.order-resize-handle::before {
    content: "";
    width: 54px;
    height: 4px;
    border-radius: 999px;
    background: rgba(255,255,255,0.9);
}

.order-card.order-resizing {
    opacity: 0.88;
    z-index: 60;
}

.order-card {
    padding-bottom: 34px;
}

.order-resize-handle {
    position: absolute !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    height: 28px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    cursor: ns-resize;
    background: rgba(0,0,0,0.18);
    border-radius: 0 0 12px 12px;
    touch-action: none;
    user-select: none;
    z-index: 5;
}

.order-resize-handle span {
    display: block;
    width: 58px;
    height: 5px;
    border-radius: 999px;
    background: white;
}

.time-bubble {
    position: fixed;
    z-index: 12000;
    background: #111827;
    color: white;
    padding: 8px 14px;
    border-radius: 999px;
    font-size: 15px;
    font-weight: bold;
    pointer-events: none;
    opacity: 0;
    transform: translateY(6px);
    transition: opacity 0.12s ease, transform 0.12s ease;
    box-shadow: 0 6px 18px rgba(0,0,0,0.28);
}

.time-bubble.show {
    opacity: 1;
    transform: translateY(0);
}

.order-card.order-conflict {
    background: #dc2626;
    box-shadow: 0 0 0 4px rgba(220,38,38,0.25), 0 3px 8px rgba(0,0,0,0.18);
}

.assignment-badge.badge-conflict {
    background: #fecaca !important;
    color: #7f1d1d;
    border: 2px solid #991b1b;
}

.conflict-warning {
    margin-top: 8px;
    padding: 6px 9px;
    border-radius: 8px;
    background: rgba(255,255,255,0.92);
    color: #991b1b;
    font-size: 13px;
    font-weight: bold;
}

.view-btn.active {
    background: #e38b29;
}

.week-view {
    display: none;
}

.week-view.active {
    display: block;
}

.calendar-wrapper.hidden {
    display: none;
}

.week-grid {
    display: grid;
    grid-template-columns: 80px repeat(7, 1fr);
    border-top: 1px solid #d1d5db;
    border-left: 1px solid #d1d5db;
    min-height: 900px;
}

.week-head,
.week-time,
.week-cell {
    border-right: 1px solid #e5e7eb;
    border-bottom: 1px solid #e5e7eb;
}

.week-head {
    background: #f9fafb;
    padding: 12px;
    font-weight: bold;
    text-align: center;
}

.week-time {
    padding: 8px;
    font-weight: bold;
    color: #6b7280;
    background: #f9fafb;
    min-height: 70px;
}

.week-cell {
    position: relative;
    min-height: 70px;
    padding: 6px;
    background: white;
}

.week-order {
    background: #e38b29;
    color: white;
    border-radius: 8px;
    padding: 8px;
    font-size: 14px;
    margin-bottom: 5px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.15);
}

.week-order.week-order-conflict {
    background: #dc2626 !important;
    box-shadow: 0 0 0 3px rgba(220,38,38,0.25), 0 2px 6px rgba(0,0,0,0.18);
}

.week-conflict-warning {
    margin-top: 6px;
    padding: 4px 6px;
    border-radius: 6px;
    background: rgba(255,255,255,0.92);
    color: #991b1b;
    font-size: 12px;
    font-weight: bold;
}

.month-view {
    display: none;
}

.month-view.active {
    display: block;
}

.month-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    border-top: 1px solid #d1d5db;
    border-left: 1px solid #d1d5db;
}

.month-head {
    background: #f9fafb;
    font-weight: bold;
    text-align: center;
    padding: 12px;
    border-right: 1px solid #e5e7eb;
    border-bottom: 1px solid #e5e7eb;
}

.month-cell {
    min-height: 150px;
    padding: 8px;
    background: white;
    border-right: 1px solid #e5e7eb;
    border-bottom: 1px solid #e5e7eb;
    position: relative;
}

.month-day-number {
    font-weight: bold;
    color: #6b7280;
    margin-bottom: 8px;
}

.month-order {
    background: #e38b29;
    color: white;
    border-radius: 8px;
    padding: 7px;
    font-size: 13px;
    margin-bottom: 6px;
    cursor: move;
    touch-action: none;
    user-select: none;
    box-shadow: 0 2px 6px rgba(0,0,0,0.15);
}

.month-order-conflict {
    background: #dc2626 !important;
}

.month-conflict-warning {
    margin-top: 5px;
    padding: 4px 6px;
    border-radius: 6px;
    background: rgba(255,255,255,0.92);
    color: #991b1b;
    font-size: 12px;
    font-weight: bold;
}

.logout-button {
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    padding: 0 18px;
    border-radius: 8px;
    background: #991b1b;
    color: white;
    text-decoration: none;
    font-size: 16px;
    font-weight: bold;
}

.logout-button:hover {
    background: #dc2626;
}

.login-page {
    min-height: 100vh;
    margin: 0;
    overflow: hidden;
    background:
        radial-gradient(
            circle at 50% 45%,
            #24364f 0%,
            #17263b 42%,
            #0f1929 100%
        );
    font-family: Arial, Helvetica, sans-serif;
}

.login-stage {
    position: relative;
    width: 100%;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 32px;
    box-sizing: border-box;
    isolation: isolate;
}

.login-stage::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -3;
    background:
        linear-gradient(
            120deg,
            rgba(255, 255, 255, 0.03),
            rgba(255, 255, 255, 0)
        );
}

.login-background-logo {
    position: absolute;
    z-index: -1;
    width: min(820px, 76vw);
    max-height: 78vh;
    object-fit: contain;
    opacity: 0.92;
    pointer-events: none;
    user-select: none;
    filter:
        drop-shadow(0 24px 45px rgba(0, 0, 0, 0.28));
}

.login-glass-card {
    position: relative;
    z-index: 2;
    width: min(430px, calc(100vw - 48px));
    padding: 36px;
    box-sizing: border-box;

    background: rgba(255, 255, 255, 0.30);

    border:
        1px solid
        rgba(255, 255, 255, 0.46);

    border-radius: 26px;

    box-shadow:
        0 28px 70px rgba(0, 0, 0, 0.34),
        inset 0 1px 0 rgba(255, 255, 255, 0.38);

    backdrop-filter: blur(18px) saturate(135%);
    -webkit-backdrop-filter: blur(18px) saturate(135%);
}

.login-heading {
    margin-bottom: 28px;
    text-align: center;
    color: #ffffff;
}

.login-heading-label {
    margin-bottom: 5px;
    font-size: 14px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.78);
}

.login-heading h1 {
    margin: 0;
    font-size: clamp(34px, 4vw, 46px);
    line-height: 1;
    color: #ffffff;
    text-shadow: 0 3px 12px rgba(0, 0, 0, 0.25);
}

.login-heading h1 span {
    color: #f28c20;
}

.login-heading p {
    margin: 14px 0 0;
    font-size: 15px;
    line-height: 1.5;
    color: rgba(255, 255, 255, 0.88);
}

.login-form {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.login-field {
    display: flex;
    flex-direction: column;
    gap: 7px;
}

.login-field label {
    font-size: 14px;
    font-weight: 700;
    color: #ffffff;
    text-shadow: 0 1px 5px rgba(0, 0, 0, 0.26);
}

.login-field input {
    width: 100%;
    height: 52px;
    padding: 0 16px;
    box-sizing: border-box;

    border:
        1px solid
        rgba(255, 255, 255, 0.62);

    border-radius: 13px;

    background: rgba(255, 255, 255, 0.70);
    color: #142033;

    font-size: 16px;
    font-weight: 600;

    outline: none;

    box-shadow:
        inset 0 1px 2px rgba(0, 0, 0, 0.07),
        0 5px 15px rgba(0, 0, 0, 0.08);

    transition:
        border-color 0.18s ease,
        background 0.18s ease,
        box-shadow 0.18s ease,
        transform 0.18s ease;
}

.login-field input::placeholder {
    color: #7b8595;
    font-weight: 400;
}

.login-field input:hover {
    background: rgba(255, 255, 255, 0.82);
}

.login-field input:focus {
    border-color: #f28c20;
    background: rgba(255, 255, 255, 0.94);

    box-shadow:
        0 0 0 4px rgba(242, 140, 32, 0.20),
        0 8px 22px rgba(0, 0, 0, 0.13);

    transform: translateY(-1px);
}

.login-submit {
    width: 100%;
    min-height: 54px;
    margin-top: 5px;

    border: 0;
    border-radius: 14px;

    background: #f28c20;
    color: #ffffff;

    font-size: 17px;
    font-weight: 800;
    letter-spacing: 0.02em;

    cursor: pointer;

    box-shadow:
        0 12px 25px rgba(185, 91, 5, 0.35);

    transition:
        background 0.18s ease,
        transform 0.18s ease,
        box-shadow 0.18s ease;
}

.login-submit:hover {
    background: #ff9d31;
    transform: translateY(-2px);

    box-shadow:
        0 16px 30px rgba(185, 91, 5, 0.42);
}

.login-submit:active {
    transform: translateY(0);
}

.login-error {
    margin-bottom: 20px;
    padding: 13px 15px;

    border:
        1px solid
        rgba(255, 175, 175, 0.75);

    border-radius: 12px;

    background: rgba(127, 29, 29, 0.76);
    color: #ffffff;

    font-size: 14px;
    font-weight: 700;
    line-height: 1.45;

    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.login-footer {
    margin-top: 24px;
    text-align: center;

    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0.15em;
    text-transform: uppercase;

    color: rgba(255, 255, 255, 0.82);
    text-shadow: 0 2px 7px rgba(0, 0, 0, 0.25);
}

@media (max-width: 650px) {
    .login-stage {
        padding: 20px;
    }

    .login-background-logo {
        width: 108vw;
        opacity: 0.66;
    }

    .login-glass-card {
        width: 100%;
        padding: 28px 22px;
        border-radius: 22px;
    }

    .login-heading h1 {
        font-size: 38px;
    }
}