
/* ========================================
   AI Venture Studio - Founder Portal V1
   ======================================== */

:root {
    --primary: #0078d4;
    --primary-dark: #005a9e;
    --sidebar: #17243c;
    --background: #f4f6fa;
    --white: #ffffff;
    --text: #243247;
    --muted: #64748b;
    --border: #e2e8f0;
    --success: #16803c;
    --danger: #dc2626;
    --warning: #d97706;
    --radius: 10px;
    --shadow: 0 3px 12px rgba(0,0,0,0.05);
}

* {
    box-sizing: border-box;
}

[hidden] {
    display: none !important;
}

body {
    margin: 0;
    font-family: "Segoe UI", Arial, sans-serif;
    background: var(--background);
    color: var(--text);
    font-size: 14px;
}

h1, h2, h3, p {
    margin-top: 0;
}

button, input, select, textarea {
    font: inherit;
}

button {
    cursor: pointer;
    border: 0;
    border-radius: 6px;
    padding: 10px 16px;
    background: var(--primary);
    color: white;
    transition: background 0.2s;
}

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

button:disabled {
    opacity: 0.55;
    cursor: not-allowed;
}

button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

input, select, textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: white;
    color: var(--text);
    margin-bottom: 14px;
}

textarea {
    min-height: 100px;
    resize: vertical;
}

input[type="checkbox"] {
    width: 18px;
    height: 18px;
    margin: 0;
    accent-color: var(--primary);
}

label {
    display: block;
    font-weight: 500;
    margin-bottom: 8px;
}

/* LOGIN PAGE */

#login-page {
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 24px;
    background: linear-gradient(
        135deg, #101c30, #24466c
    );
}

.login-card {
    width: 420px;
    max-width: 100%;
    padding: 42px;
    background: white;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.2);
}

.brand-logo {
    width: 64px;
    height: 64px;
    display: flex;
    justify-content: center;
    align-items: center;
    background: var(--primary);
    color: white;
    font-size: 25px;
    font-weight: bold;
    border-radius: 14px;
    margin: 0 auto 24px;
}

.login-card h1 {
    font-size: 26px;
    text-align: center;
    margin-bottom: 8px;
}

.login-card > p {
    text-align: center;
    color: var(--muted);
}

#login-form {
    margin-top: 30px;
}

#login-button {
    width: 100%;
    padding: 13px;
    margin-top: 6px;
}

#login-message {
    min-height: 20px;
    margin-top: 14px;
    overflow-wrap: anywhere;
}

.login-card small {
    display: block;
    text-align: center;
    color: var(--muted);
    margin-top: 24px;
}

/* PORTAL LAYOUT */

#portal {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: 245px;
    min-width: 245px;
    height: 100vh;
    position: sticky;
    top: 0;
    display: flex;
    flex-direction: column;
    background: var(--sidebar);
    color: white;
    padding: 24px 16px;
    overflow-y: auto;
}

.sidebar-brand {
    padding: 8px 10px 28px;
}

.sidebar-brand h2 {
    font-size: 19px;
    margin-bottom: 5px;
}

.sidebar-brand p {
    color: #a7b8cf;
    font-size: 12px;
}

#navigation {
    display: flex;
    flex-direction: column;
    gap: 7px;
}

#navigation button {
    width: 100%;
    text-align: left;
    background: transparent;
    color: #d2dceb;
    padding: 13px 14px;
}

#navigation button:hover {
    background: #263b58;
}

#navigation button.active {
    background: var(--primary);
    color: white;
    font-weight: 600;
}

.sidebar-footer {
    margin-top: auto;
    padding-top: 30px;
}

.sidebar-footer button {
    width: 100%;
    background: #334862;
}

.sidebar-footer small {
    display: block;
    text-align: center;
    margin-top: 15px;
    color: #a7b8cf;
}

.main-content {
    flex: 1;
    min-width: 0;
    padding: 28px 32px;
}

/* TOP BAR */

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

.topbar h1 {
    font-size: 27px;
    margin-bottom: 5px;
}

.topbar p {
    margin-bottom: 0;
    color: var(--muted);
}

.account-status {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

#connection-status {
    background: #e2e8f0;
    color: #475569;
    border-radius: 20px;
    padding: 6px 11px;
    font-size: 12px;
}

#connection-status.online {
    background: #dcfce7;
    color: var(--success);
}

#user-email {
    font-size: 13px;
    color: var(--muted);
    overflow-wrap: anywhere;
}

/* DASHBOARD */

.welcome-banner {
    padding: 30px;
    border-radius: 12px;
    background: linear-gradient(
        110deg, #005a9e, #0078d4
    );
    color: white;
    margin-bottom: 24px;
}

.welcome-banner h2 {
    font-size: 26px;
    margin-bottom: 10px;
}

.welcome-banner p {
    color: #e5f2ff;
    margin-bottom: 0;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0,1fr));
    gap: 18px;
    margin-bottom: 24px;
}

.stat-card {
    padding: 22px;
    background: white;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
}

.stat-card p {
    color: var(--muted);
    margin-bottom: 12px;
}

.stat-card h2 {
    font-size: 30px;
    margin: 0;
    overflow-wrap: anywhere;
}

.panel {
    padding: 24px;
    background: white;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    margin-bottom: 22px;
    overflow-x: auto;
}

.panel h2 {
    font-size: 19px;
    margin-bottom: 18px;
}

.panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
}

.panel-header h2 {
    margin: 0;
}

/* OUTLOOK STYLE CALENDAR */

.calendar-toolbar {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.calendar-toolbar h2 {
    flex: 1;
    text-align: center;
    margin: 0;
}

.calendar-toolbar button {
    background: #eef5fc;
    color: var(--primary);
}

.calendar-toolbar button:hover {
    background: #dbeafe;
}

#calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, minmax(0,1fr));
    border-top: 1px solid var(--border);
    border-left: 1px solid var(--border);
    min-width: 580px;
}

.calendar-weekday {
    padding: 13px;
    text-align: center;
    font-weight: 600;
    background: #f8fafc;
    border-right: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
}

.calendar-day {
    min-height: 105px;
    padding: 9px;
    background: white;
    color: var(--text);
    border-radius: 0;
    border-right: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
    text-align: left;
    overflow-wrap: anywhere;
}

.calendar-day:hover {
    background: #eff6ff;
}

.calendar-day.today {
    background: #e8f3ff;
    box-shadow: inset 0 0 0 2px var(--primary);
}

.calendar-day.selected {
    background: #dbeafe;
}

.calendar-day.other-month {
    background: #f8fafc;
    color: #94a3b8;
}

.calendar-event {
    display: block;
    padding: 5px 7px;
    margin-top: 5px;
    border-radius: 3px;
    border-left: 3px solid var(--primary);
    background: #dbeafe;
    color: #1e40af;
    font-size: 11px;
    overflow-wrap: anywhere;
}

#calendar-events {
    margin-top: 20px;
}

/* TASKS AND CHECKLIST */

.task-row,
.checklist-item,
.project-row,
.budget-row,
.risk-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 0;
    border-bottom: 1px solid var(--border);
}

.task-row:last-child,
.checklist-item:last-child,
.project-row:last-child,
.budget-row:last-child,
.risk-row:last-child {
    border-bottom: none;
}

.task-info {
    flex: 1;
    min-width: 0;
    overflow-wrap: anywhere;
}

.task-title {
    font-weight: 600;
    margin-bottom: 4px;
}

.task-meta {
    font-size: 12px;
    color: var(--muted);
}

.completed .task-title {
    text-decoration: line-through;
    color: var(--muted);
}

.empty-state {
    padding: 30px;
    text-align: center;
    color: var(--muted);
}

.status-badge {
    display: inline-block;
    padding: 5px 10px;
    background: #f1f5f9;
    color: #475569;
    border-radius: 20px;
    font-size: 12px;
}

.status-badge.completed,
.status-badge.active {
    background: #dcfce7;
    color: #166534;
}

.status-badge.pending {
    background: #fef3c7;
    color: #92400e;
}

.status-badge.high {
    background: #fee2e2;
    color: #991b1b;
}

/* TABLES */

table {
    width: 100%;
    border-collapse: collapse;
}

th, td {
    padding: 14px 12px;
    text-align: left;
    border-bottom: 1px solid var(--border);
}

th {
    background: #f8fafc;
    color: var(--muted);
    font-size: 12px;
}

tr:hover td {
    background: #fafcff;
}

.edit-button {
    background: #e8f3ff;
    color: var(--primary);
    padding: 6px 10px;
    font-size: 12px;
}

.delete-button {
    background: #fee2e2;
    color: var(--danger);
    padding: 6px 10px;
    font-size: 12px;
}

/* POPUP EDIT FORM */

dialog {
    width: 480px;
    max-width: 92vw;
    max-height: 90vh;
    overflow-y: auto;
    padding: 28px;
    border: none;
    border-radius: 14px;
    box-shadow: 0 20px 50px rgba(0,0,0,0.2);
}

dialog::backdrop {
    background: rgba(15,23,42,0.55);
}

.dialog-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 20px;
}

#cancel-edit {
    background: #e2e8f0;
    color: var(--text);
}

.error-message {
    color: var(--danger);
}

.success-message {
    color: var(--success);
}

/* TABLET */

@media (max-width: 1050px) {
    .stats-grid {
        grid-template-columns: repeat(2,minmax(0,1fr));
    }

    .main-content {
        padding: 20px;
    }

    .sidebar {
        width: 210px;
        min-width: 210px;
    }
}

/* MOBILE */

@media (max-width: 700px) {
    #portal {
        flex-direction: column;
    }

    .sidebar {
        width: 100%;
        min-width: 0;
        height: auto;
        position: relative;
        padding: 16px;
    }

    .sidebar-brand {
        padding: 5px 5px 15px;
    }

    #navigation {
        display: grid;
        grid-template-columns: repeat(2,minmax(0,1fr));
        gap: 6px;
    }

    #navigation button {
        font-size: 12px;
        padding: 11px;
    }

    .sidebar-footer {
        padding-top: 15px;
    }

    .main-content {
        padding: 16px;
    }

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

    .stats-grid {
        gap: 10px;
    }

    .stat-card {
        padding: 15px;
    }

    .stat-card h2 {
        font-size: 23px;
    }

    .panel {
        padding: 16px;
    }

    .welcome-banner {
        padding: 22px;
    }

    .login-card {
        padding: 28px;
    }

    .task-row,
    .project-row,
    .budget-row,
    .risk-row {
        flex-wrap: wrap;
    }
}
