* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background-color: #f5f5f7;
    color: #1d1d1f;
}

.container {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: 200px;
    background: linear-gradient(180deg, #1c1c1e 0%, #2c2c2e 100%);
    color: #ffffff;
    padding: 20px 0;
    position: fixed;
    height: 100vh;
    overflow-y: auto;
    border-right: 1px solid rgba(0,0,0,0.2);
}

.sidebar h1 {
    font-size: 16px;
    font-weight: 600;
    padding: 0 20px 20px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    margin-bottom: 10px;
    color: rgba(255,255,255,0.7);
}

.sidebar nav ul {
    list-style: none;
}

.sidebar nav li {
    padding: 12px 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 12px;
    transition: all 0.2s ease;
    border-radius: 0 8px 8px 0;
    margin-right: 8px;
}

.sidebar nav li:hover {
    background: rgba(255,255,255,0.08);
}

.sidebar nav li.active {
    background: rgba(255,255,255,0.12);
}

.sidebar nav li .icon {
    font-size: 16px;
    width: 20px;
    text-align: center;
}

.sidebar nav li span {
    font-size: 13px;
    font-weight: 400;
    color: rgba(255,255,255,0.85);
}

.sidebar nav li.active span {
    color: #ffffff;
    font-weight: 500;
}

.main-content {
    margin-left: 200px;
    flex: 1;
    padding: 24px;
}

.page-title {
    font-size: 24px;
    font-weight: 600;
    margin-bottom: 20px;
    color: #1d1d1f;
}

.card {
    background: #ffffff;
    border-radius: 16px;
    padding: 24px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05), 0 1px 2px rgba(0,0,0,0.03);
    margin-bottom: 20px;
    border: 1px solid rgba(0,0,0,0.06);
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 16px;
    margin-bottom: 24px;
}

@media (max-width: 1400px) {
    .stats-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

@media (max-width: 1000px) {
    .stats-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 768px) {
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

.stat-card {
    background: linear-gradient(135deg, #ffffff 0%, #fafafa 100%);
    border-radius: 16px;
    padding: 20px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.04), 0 1px 2px rgba(0,0,0,0.02);
    display: flex;
    align-items: center;
    gap: 16px;
    border: 1px solid rgba(0,0,0,0.05);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.08), 0 2px 4px rgba(0,0,0,0.04);
}

.stat-card.small {
    padding: 16px;
}

.stat-icon {
    width: 48px;
    height: 48px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    background: linear-gradient(135deg, #f0f0f0 0%, #e5e5e5 100%);
    flex-shrink: 0;
}

.stat-card.small .stat-icon {
    width: 40px;
    height: 40px;
    font-size: 18px;
}

.stat-info {
    flex: 1;
    min-width: 0;
}

.stat-value {
    font-size: 24px;
    font-weight: 700;
    color: #1d1d1f;
    line-height: 1.2;
}

.stat-card.small .stat-value {
    font-size: 20px;
}

.stat-label {
    font-size: 12px;
    color: #86868b;
    margin-top: 4px;
    font-weight: 400;
}

.btn {
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s ease;
}

.btn-primary {
    background: linear-gradient(135deg, #007aff 0%, #0066e6 100%);
    color: white;
    box-shadow: 0 2px 4px rgba(0, 122, 255, 0.3);
}

.btn-primary:hover {
    background: linear-gradient(135deg, #0066e6 0%, #0052cc 100%);
    box-shadow: 0 4px 8px rgba(0, 122, 255, 0.4);
    transform: translateY(-1px);
}

.btn-success {
    background: linear-gradient(135deg, #34c759 0%, #30d158 100%);
    color: white;
    box-shadow: 0 2px 4px rgba(52, 199, 89, 0.3);
}

.btn-success:hover {
    background: linear-gradient(135deg, #30d158 0%, #2dd36a 100%);
    box-shadow: 0 4px 8px rgba(52, 199, 89, 0.4);
}

.btn-danger {
    background: linear-gradient(135deg, #ff3b30 0%, #ff453a 100%);
    color: white;
    box-shadow: 0 2px 4px rgba(255, 59, 48, 0.3);
}

.btn-danger:hover {
    background: linear-gradient(135deg, #ff453a 100%, #ff5252 100%);
    box-shadow: 0 4px 8px rgba(255, 59, 48, 0.4);
}

.btn-warning {
    background: linear-gradient(135deg, #ff9500 0%, #ff9f0a 100%);
    color: white;
    box-shadow: 0 2px 4px rgba(255, 149, 0, 0.3);
}

.btn-warning:hover {
    background: linear-gradient(135deg, #ff9f0a 0%, #ffa940 100%);
    box-shadow: 0 4px 8px rgba(255, 149, 0, 0.4);
}

.btn-info {
    background: linear-gradient(135deg, #5ac8fa 0%, #00d4ff 100%);
    color: white;
    box-shadow: 0 2px 4px rgba(90, 200, 250, 0.3);
}

.btn-info:hover {
    background: linear-gradient(135deg, #00d4ff 0%, #64d2ff 100%);
    box-shadow: 0 4px 8px rgba(90, 200, 250, 0.4);
}

.btn-sm {
    padding: 6px 12px;
    font-size: 12px;
}

.table-container {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
}

table th, table td {
    padding: 12px 16px;
    text-align: left;
    border-bottom: 1px solid rgba(0,0,0,0.05);
}

table th {
    font-size: 12px;
    font-weight: 600;
    color: #86868b;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

table td {
    font-size: 14px;
    color: #1d1d1f;
}

table tr:hover {
    background: rgba(0,0,0,0.02);
}

.form-group {
    margin-bottom: 16px;
}

.form-group label {
    display: block;
    font-size: 13px;
    font-weight: 500;
    color: #333;
    margin-bottom: 6px;
}

.form-group input, .form-group select, .form-group textarea {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid rgba(0,0,0,0.15);
    border-radius: 8px;
    font-size: 14px;
    background: #ffffff;
    color: #1d1d1f;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.form-group input:focus, .form-group select:focus, .form-group textarea:focus {
    outline: none;
    border-color: #007aff;
    box-shadow: 0 0 0 3px rgba(0, 122, 255, 0.1);
}

.form-group input:disabled {
    background: #f5f5f7;
    color: #86868b;
}

.form-row {
    display: flex;
    gap: 16px;
}

.form-row .form-group {
    flex: 1;
}

.filter-row {
    display: flex;
    gap: 20px;
    margin-bottom: 20px;
}

.filter-row .form-group {
    flex: 1;
    max-width: 250px;
}

.data-table {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}

.data-table thead {
    background: #f8f8fa;
}

.data-table th {
    padding: 14px 16px;
}

.search-box {
    display: flex;
    align-items: center;
    background: #f5f5f7;
    border-radius: 8px;
    padding: 2px;
    border: 1px solid rgba(0,0,0,0.1);
    transition: all 0.2s ease;
}

.search-box:focus-within {
    border-color: #007aff;
    box-shadow: 0 0 0 3px rgba(0, 122, 255, 0.1);
}

.search-box input {
    border: none;
    background: transparent;
    padding: 8px 12px;
    font-size: 13px;
    width: 200px;
    outline: none;
}

.search-box input::placeholder {
    color: #86868b;
}

.search-btn {
    background: #007aff;
    border: none;
    border-radius: 6px;
    padding: 8px 12px;
    color: white;
    cursor: pointer;
    font-size: 14px;
    transition: background 0.2s ease;
}

.search-btn:hover {
    background: #0066e6;
}

.data-table td {
    padding: 14px 16px;
}

.login-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background: linear-gradient(135deg, #f5f5f7 0%, #e8e8ed 100%);
}

.login-box {
    background: white;
    padding: 40px;
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.1), 0 2px 6px rgba(0,0,0,0.05);
    width: 100%;
    max-width: 380px;
    border: 1px solid rgba(0,0,0,0.06);
}

.login-box h2 {
    font-size: 24px;
    font-weight: 600;
    text-align: center;
    margin-bottom: 8px;
    color: #1d1d1f;
}

.login-box p {
    text-align: center;
    color: #86868b;
    font-size: 14px;
    margin-bottom: 24px;
}

.error-message {
    background: rgba(255, 59, 48, 0.1);
    color: #ff3b30;
    padding: 12px 16px;
    border-radius: 8px;
    font-size: 13px;
    margin-bottom: 16px;
}

.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    align-items: center;
    justify-content: center;
    z-index: 1000;
    backdrop-filter: blur(8px);
}

.modal-overlay.show {
    display: flex;
}

.modal {
    background: white;
    border-radius: 20px;
    padding: 28px;
    width: 90%;
    max-width: 480px;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 25px 50px rgba(0,0,0,0.25), 0 10px 20px rgba(0,0,0,0.1);
    border: 1px solid rgba(0,0,0,0.08);
}

.modal h3 {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 20px;
    color: #1d1d1f;
}

.canvas-team-members-modal {
    max-width: 980px;
}

.canvas-team-help {
    margin: -8px 0 18px;
    padding: 10px 12px;
    border-radius: 10px;
    background: #f5f7fb;
    color: #667085;
    font-size: 13px;
    line-height: 1.5;
}

.canvas-team-member-add-panel {
    display: grid;
    grid-template-columns: minmax(180px, 1fr) 130px minmax(320px, 1.5fr) auto;
    gap: 12px;
    align-items: end;
    margin-bottom: 16px;
}

.canvas-team-permission-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
}

.canvas-team-permission-card {
    display: grid;
    grid-template-columns: 1fr 42px;
    align-items: center;
    gap: 10px;
    min-height: 64px;
    padding: 10px;
    border: 1px solid rgba(0, 0, 0, 0.08);
    border-radius: 12px;
    background: #ffffff;
    cursor: pointer;
    transition: border-color 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}

.canvas-team-permission-card:hover {
    border-color: rgba(0, 122, 255, 0.28);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.06);
}

.canvas-team-permission-card input,
.canvas-team-mini-permission input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.canvas-team-permission-copy {
    min-width: 0;
}

.canvas-team-permission-copy strong {
    display: block;
    color: #1d1d1f;
    font-size: 13px;
    font-weight: 700;
    margin-bottom: 4px;
}

.canvas-team-permission-copy small {
    display: block;
    color: #86868b;
    font-size: 12px;
    line-height: 1.35;
}

.canvas-team-switch {
    position: relative;
    width: 42px;
    height: 24px;
    border-radius: 999px;
    background: #d0d5dd;
    transition: background 0.18s ease;
}

.canvas-team-switch::after {
    content: '';
    position: absolute;
    top: 3px;
    left: 3px;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #ffffff;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
    transition: transform 0.18s ease;
}

.canvas-team-permission-card input:checked ~ .canvas-team-switch {
    background: #007aff;
}

.canvas-team-permission-card input:checked ~ .canvas-team-switch::after {
    transform: translateX(18px);
}

.canvas-team-add-button {
    height: 44px;
    white-space: nowrap;
}

.canvas-team-transfer-row {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 10px;
    align-items: end;
    margin-bottom: 16px;
}

.canvas-team-mini-permission {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    min-height: 24px;
    padding: 3px 7px 3px 5px;
    border: 1px solid #d0d5dd;
    border-radius: 999px;
    color: #667085;
    background: #ffffff;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    user-select: none;
}

.canvas-team-mini-permission:has(input:disabled) {
    cursor: default;
    opacity: 0.76;
}

.canvas-team-mini-check {
    position: relative;
    width: 15px;
    height: 15px;
    border-radius: 50%;
    border: 1px solid #98a2b3;
    background: #ffffff;
}

.canvas-team-mini-permission input:checked ~ .canvas-team-mini-check {
    border-color: #007aff;
    background: #007aff;
}

.canvas-team-mini-permission input:checked ~ .canvas-team-mini-check::after {
    content: '';
    position: absolute;
    left: 4px;
    top: 2px;
    width: 4px;
    height: 7px;
    border: solid #ffffff;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

.canvas-team-mini-permission input:checked ~ span:last-child {
    color: #1d4ed8;
}

@media (max-width: 980px) {
    .canvas-team-member-add-panel {
        grid-template-columns: 1fr;
    }

    .canvas-team-permission-grid {
        grid-template-columns: 1fr;
    }
}

.modal-content {
    background: white;
    border-radius: 20px;
    padding: 28px;
    width: 90%;
    max-width: 480px;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 25px 50px rgba(0,0,0,0.25), 0 10px 20px rgba(0,0,0,0.1);
}

.modal-content h3 {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 20px;
}

.modal-overlay.show {
    display: flex;
}

.alert {
    padding: 14px 18px;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 500;
}

.alert-success {
    background: linear-gradient(135deg, rgba(52, 199, 89, 0.1) 0%, rgba(48, 209, 88, 0.1) 100%);
    color: #30d158;
    border: 1px solid rgba(52, 199, 89, 0.2);
}

.alert-error {
    background: linear-gradient(135deg, rgba(255, 59, 48, 0.1) 0%, rgba(255, 69, 58, 0.1) 100%);
    color: #ff453a;
    border: 1px solid rgba(255, 59, 48, 0.2);
}

.alert-warning {
    background: linear-gradient(135deg, rgba(255, 149, 0, 0.1) 0%, rgba(255, 159, 10, 0.1) 100%);
    color: #ff9f0a;
    border: 1px solid rgba(255, 149, 0, 0.2);
}

.checkbox-container {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
}

.checkbox-container input[type="checkbox"] {
    width: 18px;
    height: 18px;
    border-radius: 6px;
    accent-color: #007aff;
}

.checkbox-container label {
    font-size: 14px;
    color: #333;
    margin-bottom: 0;
}
