* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: Arial, sans-serif;
    background: #05070b;
    color: #ffffff;
    min-height: 100vh;
    padding-bottom: 70px;
}

/* LOGIN */
.login-wrapper {
    min-height: calc(100vh - 70px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
}

.login-card {
    width: 100%;
    max-width: 460px;
    background: rgba(28, 28, 32, 0.95);
    border-radius: 18px;
    padding: 38px 34px;
    box-shadow: 0 0 30px rgba(255, 255, 255, 0.06);
}

.login-card h1 {
    margin: 0 0 28px;
    text-align: center;
    font-size: 22px;
    font-weight: 700;
}

.login-form {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.login-form label {
    font-size: 14px;
    font-weight: 600;
    color: #f1f1f1;
}

.login-form input,
.target-field input,
.task-input-wrap input,
.admin-select {
    height: 48px;
    border: none;
    border-radius: 8px;
    padding: 0 14px;
    font-size: 15px;
    background: #2a2a2f;
    color: #ffffff;
    outline: none;
}

.login-form input:focus,
.target-field input:focus,
.task-input-wrap input:focus,
.admin-select:focus,
.upload-form input[type="file"]:focus {
    box-shadow: 0 0 0 2px rgba(33, 128, 255, 0.35);
}

.login-form button,
.primary-btn {
    margin-top: 10px;
    height: 48px;
    border: none;
    border-radius: 10px;
    background: #1683ff;
    color: white;
    font-size: 17px;
    font-weight: 600;
    cursor: pointer;
}

.login-form button:hover,
.primary-btn:hover {
    background: #0f73e6;
}

.primary-btn:disabled,
.ghost-btn:disabled {
    background: rgba(255, 255, 255, 0.12);
    color: #9aa3b3;
    cursor: not-allowed;
}

.error-box {
    margin-bottom: 16px;
    padding: 12px 14px;
    border-radius: 8px;
    background: rgba(255, 80, 80, 0.15);
    color: #ffb3b3;
    font-size: 14px;
}

.success-box {
    margin-bottom: 16px;
    padding: 12px 14px;
    border-radius: 8px;
    background: rgba(60, 180, 100, 0.15);
    color: #b8ffd0;
    font-size: 14px;
}

/* DASHBOARD */
.dashboard-shell {
    min-height: calc(100vh - 70px);
    padding: 32px;
    background: #05070b;
    color: #ffffff;
}

.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 28px;
    gap: 16px;
}

.topbar-left h1 {
    margin: 0;
    font-size: 32px;
    font-weight: 700;
}

.topbar-left p {
    margin: 8px 0 0;
    color: #b8bcc8;
    font-size: 15px;
}

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

.ghost-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 44px;
    padding: 0 18px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.06);
    color: #ffffff;
    text-decoration: none;
    font-weight: 600;
    transition: background 0.2s ease;
}

.ghost-btn:hover {
    background: rgba(255, 255, 255, 0.12);
}

.dashboard-card {
    max-width: 1080px;
    background: rgba(28, 28, 32, 0.95);
    border-radius: 20px;
    padding: 28px;
    box-shadow: 0 0 30px rgba(255, 255, 255, 0.05);
}

.dashboard-card h2 {
    margin: 0 0 10px;
    font-size: 24px;
    font-weight: 700;
}

.activity-table {
    width: 100%;
    border-collapse: collapse;
    color: #ffffff;
}

.activity-table th,
.activity-table td {
    padding: 14px 16px;
    text-align: left;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.activity-table th {
    color: #b8bcc8;
    font-size: 13px;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

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

.muted {
    margin: 0;
    color: #aeb4c2;
    font-size: 15px;
}

.flash-list {
    margin-top: 18px;
}

/* UPLOAD */
.upload-form {
    margin-top: 22px;
    display: flex;
    flex-direction: column;
    gap: 14px;
    max-width: 520px;
}

.upload-form label {
    font-size: 14px;
    font-weight: 600;
    color: #f1f1f1;
}

.upload-form input[type="file"] {
    border: none;
    border-radius: 10px;
    padding: 14px;
    font-size: 14px;
    background: #2a2a2f;
    color: #ffffff;
}

/* TARGETS / ADMIN */
.targets-form,
.tasks-form,
.admin-form {
    margin-top: 20px;
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.action-row {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.action-row .primary-btn {
    flex: 1 1 220px;
    margin-top: 0;
}

.target-row {
    display: grid;
    grid-template-columns: 160px 1fr 1fr;
    gap: 18px;
    align-items: end;
    padding: 16px;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.03);
}

.target-day {
    font-size: 18px;
    font-weight: 700;
    color: #ffffff;
}

.target-delivery-row {
    grid-template-columns: 160px 1fr 1fr;
}

.target-field {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.target-field label {
    font-size: 14px;
    font-weight: 600;
    color: #f1f1f1;
}

.delivery-email-value {
    min-height: 48px;
    display: flex;
    align-items: center;
    padding: 0 14px;
    border-radius: 8px;
    background: #2a2a2f;
    color: #d9deea;
    word-break: break-word;
}

.checkbox-wrap {
    justify-content: end;
}

.checkbox-wrap input[type="checkbox"] {
    width: 22px;
    height: 22px;
    align-self: flex-start;
}

/* TASKS */
.task-row {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 18px;
    align-items: center;
    padding: 16px;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.03);
}

.task-meta {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.task-day {
    font-size: 17px;
    font-weight: 700;
}

.task-person,
.task-time {
    color: #c2c8d4;
    font-size: 14px;
}

.task-input-wrap {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.task-input-wrap label {
    font-size: 14px;
    font-weight: 600;
    color: #f1f1f1;
}

/* PROCESSING */
.processing-shell {
    min-height: calc(100vh - 70px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
}

.processing-card {
    width: 100%;
    max-width: 520px;
    background: rgba(28, 28, 32, 0.95);
    border-radius: 20px;
    padding: 42px 34px;
    box-shadow: 0 0 30px rgba(255, 255, 255, 0.06);
    text-align: center;
}

.processing-card h1 {
    margin: 18px 0 10px;
    font-size: 28px;
}

.processing-card p {
    margin: 0;
    color: #b8bcc8;
}

.processing-nav {
    margin-top: 24px;
    display: flex;
    justify-content: center;
    gap: 12px;
    flex-wrap: wrap;
}

.spinner {
    width: 64px;
    height: 64px;
    margin: 0 auto;
    border: 6px solid rgba(255, 255, 255, 0.16);
    border-top-color: #1683ff;
    border-radius: 50%;
    animation: spin 0.9s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* MODAL */
.modal {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.65);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    z-index: 1000;
}

.modal.hidden {
    display: none;
}

.modal-card {
    width: 100%;
    max-width: 480px;
    background: rgba(28, 28, 32, 0.98);
    border-radius: 20px;
    padding: 30px;
    box-shadow: 0 0 30px rgba(255,255,255,0.08);
    text-align: center;
}

.modal-card h2 {
    margin-top: 0;
}

/* ADMIN */
.admin-page {
    display: flex;
    flex-direction: column;
    gap: 24px;
    max-width: 1280px;
}

.admin-panel {
    max-width: none;
}

.admin-panel-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
    margin-bottom: 18px;
}

.admin-panel-header h2 {
    margin-bottom: 6px;
}

.admin-count {
    min-width: fit-content;
    padding: 10px 14px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.05);
    color: #cdd4e2;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.admin-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 18px;
}

.admin-create-form .target-field input,
.admin-profile-grid .target-field input,
.admin-section-card .target-field input {
    width: 100%;
    min-width: 0;
}

.admin-create-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
}

.admin-submit-btn {
    min-width: 220px;
    margin-top: 0;
}

.admin-checkbox-row {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    margin: 0;
    color: #eef2fb;
    font-weight: 600;
}

.admin-checkbox-row input[type="checkbox"] {
    width: 18px;
    height: 18px;
    margin: 0;
}

.admin-user-list {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.admin-user-card {
    display: flex;
    flex-direction: column;
    gap: 18px;
    padding: 0;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 18px;
    background: linear-gradient(180deg, rgba(36, 36, 42, 0.98), rgba(24, 24, 28, 0.98));
}

.admin-user-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    padding: 18px 22px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    background: rgba(255, 255, 255, 0.03);
    color: #d9deea;
}

.admin-role-badge {
    padding: 8px 12px;
    border-radius: 999px;
    background: rgba(22, 131, 255, 0.16);
    color: #8fc0ff;
    font-size: 13px;
    font-weight: 700;
}

.admin-user-body {
    display: grid;
    grid-template-columns: minmax(0, 1.4fr) minmax(320px, 0.9fr);
    gap: 18px;
    padding: 0 22px 22px;
}

.admin-side-column {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.admin-section-card,
.admin-danger-card {
    display: flex;
    flex-direction: column;
    gap: 18px;
    min-width: 0;
    padding: 18px;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.03);
}

.admin-section-header h3 {
    margin: 0 0 6px;
    font-size: 18px;
}

.admin-section-header p {
    margin: 0;
    color: #b8bcc8;
    font-size: 14px;
}

.admin-profile-grid {
    display: grid;
    grid-template-columns: minmax(140px, 180px) minmax(240px, 1fr);
    gap: 18px;
    align-items: end;
}

.admin-profile-span {
    grid-column: 1 / -1;
}

.admin-section-actions {
    display: flex;
    justify-content: flex-start;
}

.admin-inline-btn {
    width: 100%;
    max-width: 260px;
    margin-top: 0;
}

.admin-danger-card {
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.admin-danger-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    margin-top: 8px;
    padding-top: 16px;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.admin-danger-note {
    color: #f2b8c4;
    font-size: 13px;
    line-height: 1.4;
}

.admin-danger-btn {
    min-width: 180px;
    margin-top: 0;
    background: #cf3f5d;
}

.admin-danger-btn:hover {
    background: #b6314d;
}

@media (max-width: 900px) {
    .admin-danger-actions {
        flex-direction: column;
        align-items: stretch;
    }

    .admin-danger-note {
        text-align: left;
    }
}

/* FOOTER */
.site-footer {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(10, 12, 18, 0.96);
    color: #b8bcc8;
    text-align: center;
    padding: 14px 18px;
    font-size: 13px;
    border-top: 1px solid rgba(255,255,255,0.07);
    z-index: 999;
}

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

    .admin-grid,
    .admin-user-body,
    .admin-profile-grid {
        grid-template-columns: 1fr;
    }

    .task-row {
        grid-template-columns: 1fr;
    }

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

    .admin-panel-header,
    .admin-create-footer {
        flex-direction: column;
        align-items: flex-start;
    }

    .admin-submit-btn,
    .admin-inline-btn,
    .admin-danger-btn {
        width: 100%;
        max-width: none;
    }

    .admin-user-header,
    .admin-user-body {
        padding-left: 18px;
        padding-right: 18px;
    }

}
