/* Critical Path - New Store Development Styles */

:root {
    --primary: #2563eb;
    --primary-dark: #1d4ed8;
    --secondary: #7c3aed;
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    --gray-50: #f9fafb;
    --gray-100: #f3f4f6;
    --gray-200: #e5e7eb;
    --gray-300: #d1d5db;
    --gray-400: #9ca3af;
    --gray-500: #6b7280;
    --gray-600: #4b5563;
    --gray-700: #374151;
    --gray-800: #1f2937;
    --gray-900: #111827;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: var(--gray-50);
    color: var(--gray-900);
    line-height: 1.5;
    min-height: 100vh;
}

a {
    color: var(--primary);
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

/* Header */
.header {
    background: white;
    border-bottom: 1px solid var(--gray-200);
    padding: 1rem 0;
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 1rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.logo {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--gray-900);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.logo:hover {
    text-decoration: none;
}

.nav {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.nav a {
    color: var(--gray-600);
    font-weight: 500;
    transition: color 0.2s;
}

.nav a:hover, .nav a.active {
    color: var(--primary);
    text-decoration: none;
}

/* Main container */
.container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 2rem 1rem;
}

/* Page header */
.page-header {
    margin-bottom: 2rem;
}

.page-header h1 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--gray-900);
}

.page-header p {
    color: var(--gray-600);
    margin-top: 0.25rem;
}

/* Cards */
.card {
    background: white;
    border-radius: 0.5rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    padding: 1.5rem;
}

.card-title {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--gray-500);
    margin-bottom: 0.5rem;
}

/* Grid */
.grid {
    display: grid;
    gap: 1rem;
}

.grid-cols-2 { grid-template-columns: repeat(2, 1fr); }
.grid-cols-3 { grid-template-columns: repeat(3, 1fr); }
.grid-cols-4 { grid-template-columns: repeat(4, 1fr); }
.grid-cols-6 { grid-template-columns: repeat(6, 1fr); }

@media (max-width: 768px) {
    .grid-cols-2, .grid-cols-3, .grid-cols-4, .grid-cols-6 {
        grid-template-columns: 1fr;
    }
}

/* Stats */
.stat-value {
    font-size: 2rem;
    font-weight: 600;
    color: var(--gray-900);
}

.stat-value.success { color: var(--success); }
.stat-value.danger { color: var(--danger); }

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.625rem 1rem;
    font-size: 0.875rem;
    font-weight: 500;
    border-radius: 0.375rem;
    border: none;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-primary {
    background: var(--primary);
    color: white;
}

.btn-primary:hover {
    background: var(--primary-dark);
}

.btn-secondary {
    background: var(--secondary);
    color: white;
}

.btn-secondary:hover {
    background: #6d28d9;
}

.btn-success {
    background: var(--success);
    color: white;
}

.btn-warning {
    background: var(--warning);
    color: white;
}

.btn-danger {
    background: var(--danger);
    color: white;
}

.btn-outline {
    background: white;
    border: 1px solid var(--gray-300);
    color: var(--gray-700);
}

.btn-outline:hover {
    background: var(--gray-50);
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-sm {
    padding: 0.375rem 0.75rem;
    font-size: 0.75rem;
}

/* Forms */
.form-group {
    margin-bottom: 1rem;
}

.form-label {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--gray-700);
    margin-bottom: 0.375rem;
}

.form-input, .form-select, .form-textarea {
    width: 100%;
    padding: 0.625rem 0.75rem;
    font-size: 0.875rem;
    border: 1px solid var(--gray-300);
    border-radius: 0.375rem;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.form-input:focus, .form-select:focus, .form-textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.form-help {
    font-size: 0.75rem;
    color: var(--gray-500);
    margin-top: 0.25rem;
}

/* Tables */
.table {
    width: 100%;
    border-collapse: collapse;
}

.table th, .table td {
    padding: 0.75rem 1rem;
    text-align: left;
    border-bottom: 1px solid var(--gray-200);
}

.table th {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--gray-500);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* Badges */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.625rem;
    font-size: 0.75rem;
    font-weight: 500;
    border-radius: 9999px;
}

.badge-gray { background: var(--gray-100); color: var(--gray-700); }
.badge-blue { background: #dbeafe; color: #1e40af; }
.badge-green { background: #d1fae5; color: #065f46; }
.badge-yellow { background: #fef3c7; color: #92400e; }
.badge-orange { background: #ffedd5; color: #c2410c; }
.badge-red { background: #fee2e2; color: #991b1b; }

/* Project card */
.project-card {
    background: white;
    border-radius: 0.5rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    padding: 1rem;
    transition: box-shadow 0.2s;
    cursor: pointer;
}

.project-card:hover {
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.project-card h3 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--gray-900);
}

.project-card .location {
    font-size: 0.875rem;
    color: var(--gray-500);
}

/* Progress bar */
.progress-bar {
    height: 0.5rem;
    background: var(--gray-200);
    border-radius: 9999px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: var(--success);
    border-radius: 9999px;
    transition: width 0.3s;
}

/* Milestone timeline */
.timeline {
    position: relative;
}

.milestone-item {
    position: relative;
    padding-left: 2.5rem;
    padding-bottom: 1.5rem;
}

.milestone-item:last-child {
    padding-bottom: 0;
}

.milestone-item::before {
    content: '';
    position: absolute;
    left: 0.75rem;
    top: 1.5rem;
    bottom: 0;
    width: 2px;
    background: var(--gray-200);
}

.milestone-item:last-child::before {
    display: none;
}

.milestone-marker {
    position: absolute;
    left: 0;
    top: 0.25rem;
    width: 1.5rem;
    height: 1.5rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
}

.milestone-marker.not-started { background: var(--gray-200); color: var(--gray-600); }
.milestone-marker.in-progress { background: #dbeafe; color: var(--primary); }
.milestone-marker.pending-approval { background: #ffedd5; color: #c2410c; }
.milestone-marker.completed { background: #d1fae5; color: var(--success); }
.milestone-marker.blocked { background: #fee2e2; color: var(--danger); }
.milestone-marker.skipped { background: #fef3c7; color: #92400e; }

.milestone-content {
    background: white;
    border: 1px solid var(--gray-200);
    border-radius: 0.5rem;
    padding: 1rem;
}

.milestone-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
}

.milestone-title {
    font-weight: 600;
    color: var(--gray-900);
}

.milestone-description {
    font-size: 0.875rem;
    color: var(--gray-600);
    margin-top: 0.25rem;
}

.milestone-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    margin-top: 0.75rem;
    font-size: 0.75rem;
    color: var(--gray-500);
}

.milestone-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--gray-100);
}

/* Status summary */
.status-summary {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 0.5rem;
}

@media (max-width: 768px) {
    .status-summary {
        grid-template-columns: repeat(3, 1fr);
    }
}

.status-item {
    text-align: center;
    padding: 0.75rem;
    border-radius: 0.375rem;
}

.status-item .count {
    font-size: 1.25rem;
    font-weight: 600;
}

.status-item .label {
    font-size: 0.75rem;
}

/* Modal */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 1rem;
}

.modal {
    background: white;
    border-radius: 0.5rem;
    width: 100%;
    max-width: 32rem;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
}

.modal-header {
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--gray-200);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.modal-header h2 {
    font-size: 1.125rem;
    font-weight: 600;
}

.modal-body {
    padding: 1.5rem;
}

.modal-footer {
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--gray-200);
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--gray-400);
    padding: 0.25rem;
    line-height: 1;
}

.modal-close:hover {
    color: var(--gray-600);
}

/* Alert */
.alert {
    padding: 1rem;
    border-radius: 0.5rem;
    margin-bottom: 1rem;
}

.alert-info {
    background: #dbeafe;
    color: #1e40af;
    border: 1px solid #93c5fd;
}

.alert-success {
    background: #d1fae5;
    color: #065f46;
    border: 1px solid #6ee7b7;
}

.alert-warning {
    background: #ffedd5;
    color: #c2410c;
    border: 1px solid #fdba74;
}

.alert-danger {
    background: #fee2e2;
    color: #991b1b;
    border: 1px solid #fca5a5;
}

/* Notifications */
.notification-bell {
    position: relative;
    cursor: pointer;
}

.notification-badge {
    position: absolute;
    top: -0.25rem;
    right: -0.25rem;
    background: var(--danger);
    color: white;
    font-size: 0.625rem;
    font-weight: 600;
    width: 1.25rem;
    height: 1.25rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.notification-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    width: 20rem;
    background: white;
    border-radius: 0.5rem;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
    margin-top: 0.5rem;
    z-index: 100;
    max-height: 24rem;
    overflow-y: auto;
}

.notification-item {
    padding: 1rem;
    border-bottom: 1px solid var(--gray-100);
    cursor: pointer;
    transition: background 0.2s;
}

.notification-item:hover {
    background: var(--gray-50);
}

.notification-item.unread {
    background: #f0f9ff;
}

.notification-item:last-child {
    border-bottom: none;
}

/* Quick actions */
.quick-actions {
    display: flex;
    gap: 1rem;
    margin-bottom: 2rem;
}

/* Empty state */
.empty-state {
    text-align: center;
    padding: 3rem;
    background: white;
    border: 2px dashed var(--gray-200);
    border-radius: 0.5rem;
}

.empty-state p {
    color: var(--gray-500);
    margin-bottom: 1rem;
}

/* Loading */
.loading {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 3rem;
    color: var(--gray-500);
}

.spinner {
    width: 2rem;
    height: 2rem;
    border: 3px solid var(--gray-200);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* Section divider */
.section-divider {
    border-top: 1px solid var(--gray-200);
    padding-top: 1.5rem;
    margin-top: 1.5rem;
}

/* Info cards grid */
.info-cards {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
    margin-bottom: 2rem;
}

@media (max-width: 768px) {
    .info-cards {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Project lists */
.project-list-section {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 2rem;
}

@media (max-width: 1024px) {
    .project-list-section {
        grid-template-columns: 1fr;
    }
}

.section-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.section-header .icon {
    width: 2rem;
    height: 2rem;
    border-radius: 0.375rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.section-header .icon.blue { background: #dbeafe; color: var(--primary); }
.section-header .icon.purple { background: #ede9fe; color: var(--secondary); }

.section-header h2 {
    font-size: 1.125rem;
    font-weight: 600;
}

/* Utility classes */
.hidden { display: none !important; }
.flex { display: flex; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-1 { gap: 0.25rem; }
.gap-2 { gap: 0.5rem; }
.gap-4 { gap: 1rem; }
.mt-1 { margin-top: 0.25rem; }
.mt-2 { margin-top: 0.5rem; }
.mt-4 { margin-top: 1rem; }
.mb-2 { margin-bottom: 0.5rem; }
.mb-4 { margin-bottom: 1rem; }
.text-sm { font-size: 0.875rem; }
.text-xs { font-size: 0.75rem; }
.text-gray-500 { color: var(--gray-500); }
.text-gray-600 { color: var(--gray-600); }
.font-medium { font-weight: 500; }
.font-semibold { font-weight: 600; }
.text-danger { color: var(--danger); }
.badge-purple { background: #ede9fe; color: #6d28d9; }

/* User Menu */
.user-menu {
    position: relative;
    margin-left: 1rem;
}

.user-menu-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.25rem 0.5rem;
    border-radius: 0.375rem;
    transition: background 0.2s;
}

.user-menu-btn:hover {
    background: var(--gray-100);
}

.user-avatar {
    width: 2rem;
    height: 2rem;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.875rem;
}

.user-name {
    font-weight: 500;
    color: var(--gray-700);
}

.user-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    width: 16rem;
    background: white;
    border-radius: 0.5rem;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
    margin-top: 0.5rem;
    z-index: 200;
    display: none;
}

.user-dropdown.show {
    display: block;
}

.user-dropdown-header {
    padding: 1rem;
    border-bottom: 1px solid var(--gray-100);
}

.user-dropdown-name {
    font-weight: 600;
    color: var(--gray-900);
}

.user-dropdown-email {
    font-size: 0.875rem;
    color: var(--gray-500);
    margin-top: 0.125rem;
}

.user-dropdown-role {
    margin-top: 0.5rem;
    display: inline-block;
}

.user-dropdown-divider {
    height: 1px;
    background: var(--gray-100);
}

.user-dropdown-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    color: var(--gray-700);
    font-size: 0.875rem;
    transition: background 0.2s;
}

.user-dropdown-item:hover {
    background: var(--gray-50);
    text-decoration: none;
}

.user-dropdown-item.text-danger {
    color: var(--danger);
}

.user-dropdown-item svg {
    color: var(--gray-400);
}

.user-dropdown-item.text-danger svg {
    color: var(--danger);
}

@media (max-width: 640px) {
    .user-name {
        display: none;
    }
}

/* Footer */
.site-footer {
    background: white;
    border-top: 1px solid var(--gray-200);
    padding: 1.5rem 0;
    margin-top: 3rem;
}

.footer-container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 1rem;
}

.footer-content {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.footer-brand {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.footer-logo {
    font-weight: 700;
    color: var(--gray-900);
}

.footer-tagline {
    font-size: 0.875rem;
    color: var(--gray-500);
}

.footer-legal {
    flex: 1;
    text-align: center;
}

.footer-notice {
    font-size: 0.75rem;
    color: var(--gray-500);
    display: inline-flex;
    align-items: center;
    background: var(--gray-50);
    padding: 0.5rem 0.75rem;
    border-radius: 0.375rem;
    border: 1px solid var(--gray-200);
}

.footer-links {
    text-align: right;
}

.footer-copyright {
    font-size: 0.75rem;
    color: var(--gray-500);
}

@media (max-width: 768px) {
    .footer-content {
        flex-direction: column;
        text-align: center;
    }

    .footer-legal {
        order: 3;
    }

    .footer-links {
        text-align: center;
    }
}

/* Task Notes */
.notes-section {
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--gray-200);
}

.notes-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1rem;
}

.notes-header h3 {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--gray-700);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.notes-count {
    background: var(--gray-100);
    color: var(--gray-600);
    font-size: 0.75rem;
    padding: 0.125rem 0.5rem;
    border-radius: 9999px;
    font-weight: 500;
}

.notes-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    max-height: 400px;
    overflow-y: auto;
    margin-bottom: 1rem;
}

.note-item {
    background: var(--gray-50);
    border: 1px solid var(--gray-200);
    border-radius: 0.5rem;
    padding: 0.75rem 1rem;
}

.note-item.pm-note {
    background: #f0f9ff;
    border-color: #bae6fd;
}

.note-item.system-note {
    background: #fefce8;
    border-color: #fde047;
}

.note-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.5rem;
}

.note-author {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.note-avatar {
    width: 1.5rem;
    height: 1.5rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.625rem;
    font-weight: 600;
    color: white;
}

.note-avatar.pm {
    background: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%);
}

.note-avatar.assignee {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
}

.note-avatar.system {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
}

.note-author-name {
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--gray-800);
}

.note-author-type {
    font-size: 0.6875rem;
    color: var(--gray-500);
    background: var(--gray-200);
    padding: 0.125rem 0.375rem;
    border-radius: 0.25rem;
    text-transform: uppercase;
    letter-spacing: 0.025em;
}

.note-timestamp {
    font-size: 0.6875rem;
    color: var(--gray-400);
}

.note-content {
    font-size: 0.875rem;
    color: var(--gray-700);
    line-height: 1.5;
    white-space: pre-wrap;
}

.note-form {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.note-input {
    width: 100%;
    min-height: 80px;
    padding: 0.75rem;
    font-size: 0.875rem;
    border: 1px solid var(--gray-300);
    border-radius: 0.375rem;
    resize: vertical;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.note-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.note-form-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.note-form-hint {
    font-size: 0.6875rem;
    color: var(--gray-400);
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.notes-empty {
    text-align: center;
    padding: 1.5rem;
    color: var(--gray-500);
    font-size: 0.875rem;
}

.notes-loading {
    text-align: center;
    padding: 1rem;
    color: var(--gray-400);
}

/* Notes modal */
.notes-modal {
    max-width: 600px;
}

.notes-modal .modal-body {
    padding: 0;
}

.notes-modal-content {
    max-height: 60vh;
    overflow-y: auto;
    padding: 1.5rem;
}

.notes-modal-form {
    padding: 1rem 1.5rem;
    background: var(--gray-50);
    border-top: 1px solid var(--gray-200);
}

/* Sub-milestones */
.sub-milestones {
    margin-top: 1rem;
    padding-left: 1rem;
    border-left: 2px solid var(--gray-200);
}

.sub-milestone-item {
    padding-left: 2rem;
}

.sub-milestone-item .milestone-marker {
    width: 1.25rem;
    height: 1.25rem;
    font-size: 0.625rem;
}

.sub-milestone-item .milestone-content {
    background: var(--gray-50);
    border-color: var(--gray-200);
}

.sub-milestone-item .milestone-title {
    font-size: 0.9375rem;
}

.sub-milestone-indicator {
    color: var(--gray-400);
    margin-right: 0.25rem;
}

.sub-milestone-item::before {
    left: 0.625rem;
}

.sub-milestone-item .milestone-marker {
    left: 0;
}
