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

/* BASE */
:root {
    --black: #111111;
    --charcoal: #1d1d1d;
    --gold: #C5A253;
    --gold-dark: #b48f3d;
    --cream: #f8f5ee;
    --light-bg: #f4f4f4;
    --white: #ffffff;
    --border: #dddddd;
    --muted: #666666;
    --success-bg: #d4edda;
    --success-text: #155724;
    --error-bg: #f8d7da;
    --error-text: #721c24;
    --danger: #c0392b;
    --danger-dark: #a93226;
    --shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
    --radius: 12px;
}

html, body {
    min-height: 100%;
}

body {
    font-family: Arial, Helvetica, sans-serif;
    background: var(--light-bg);
    color: var(--black);
    line-height: 1.45;
}

a {
    color: inherit;
}

img {
    max-width: 100%;
    display: block;
}

/* TOPBAR */
.topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    background: #000;
    color: var(--gold);
    padding: 12px 20px;
    min-height: 62px;
}

.topbar-left,
.topbar-right {
    width: 220px;
    display: flex;
    align-items: center;
}

.topbar-right {
    justify-content: flex-end;
}

.topbar-center {
    flex: 1;
    text-align: center;
    font-size: 18px;
    font-weight: bold;
    letter-spacing: 0.3px;
}

.topbar a {
    color: var(--gold);
    text-decoration: none;
    font-weight: bold;
}

.topbar a:hover {
    text-decoration: underline;
}

/* LAYOUT */
.container {
    max-width: 1240px;
    margin: 26px auto;
    padding: 0 20px 28px;
}

.auth-page {
    background:
        linear-gradient(rgba(0,0,0,0.03), rgba(0,0,0,0.03)),
        var(--light-bg);
}

.auth-shell {
    min-height: calc(100vh - 62px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 32px 20px;
}

.page-intro {
    text-align: center;
    margin-bottom: 24px;
}

.page-intro h1 {
    font-size: 32px;
    margin-bottom: 8px;
    color: var(--black);
}

.page-intro p {
    color: var(--muted);
    font-size: 16px;
}

/* HEADINGS */
h1, h2, h3 {
    line-height: 1.2;
}

h2 {
    margin-bottom: 14px;
    color: var(--black);
}

h3 {
    color: var(--gold);
    margin-bottom: 10px;
}

/* CARDS / PANELS */
.dashboard-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
    margin-bottom: 28px;
}

.dashboard-card,
.action-panel,
.preview-panel,
.login-box {
    background: var(--white);
    border: 1px solid rgba(0, 0, 0, 0.08);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.dashboard-card,
.action-panel,
.preview-panel {
    padding: 22px;
}

.dashboard-card h2,
.action-panel h2,
.preview-panel h2 {
    margin-bottom: 10px;
}

.action-panel {
    margin-bottom: 24px;
}

.action-panel-header {
    margin-bottom: 14px;
}

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

.preview-header {
    margin-bottom: 14px;
}

.preview-header p {
    color: var(--muted);
}

.preview-controls {
    margin-bottom: 18px;
}

.preview-controls select,
.stack-form input,
.stack-form select,
.stack-form textarea,
.login-box input,
.login-box select,
.login-box textarea,
.container select {
    width: 100%;
    padding: 12px 14px;
    border: 1px solid #cfcfcf;
    border-radius: 8px;
    font: inherit;
    background: var(--white);
}

.preview-controls select {
    max-width: 340px;
}

.mini-calendar-shell {
    min-height: 220px;
}

.preview-placeholder {
    text-align: center;
    padding: 40px 10px;
}

/* SPACE CARDS */
.space-list {
    display: grid;
    gap: 12px;
}

.space-card {
    display: block;
    background: var(--white);
    color: var(--black);
    padding: 14px 16px;
    border-radius: 10px;
    text-decoration: none;
    border: 1px solid var(--border);
    font-weight: 600;
    transition: 0.2s ease;
}

.space-card:hover {
    background: #fbf6ea;
    border-color: var(--gold);
    transform: translateY(-1px);
}

/* BUTTONS */
.btn {
    background: var(--gold);
    color: #000;
    padding: 11px 16px;
    border-radius: 8px;
    text-decoration: none;
    display: inline-block;
    border: none;
    cursor: pointer;
    font: inherit;
    font-weight: 700;
    transition: 0.2s ease;
    text-align: center;
}

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

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

.btn-secondary:hover {
    background: #000;
}

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

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

.btn-block {
    width: 100%;
}

/* ALERTS */
.alert {
    padding: 12px 14px;
    border-radius: 10px;
    margin-bottom: 18px;
    border: 1px solid transparent;
}

.alert-success {
    background: var(--success-bg);
    color: var(--success-text);
    border-color: #b7dfc2;
}

.alert-error {
    background: var(--error-bg);
    color: var(--error-text);
    border-color: #efb7be;
}

.muted-text {
    color: var(--muted);
}

/* TABLES */
.table {
    width: 100%;
    border-collapse: collapse;
    background: var(--white);
    margin-top: 20px;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: var(--shadow);
}

.table th,
.table td {
    border: 1px solid #e8e8e8;
    padding: 12px 10px;
    text-align: center;
    vertical-align: middle;
}

.table th {
    background: var(--charcoal);
    color: var(--gold);
}

.table tr:nth-child(even) td {
    background: #fafafa;
}

/* LOGIN */
.login-box {
    width: 100%;
    max-width: 430px;
    padding: 28px;
}

.login-header {
    text-align: center;
    margin-bottom: 20px;
}

.login-header h1 {
    font-size: 30px;
    margin-bottom: 8px;
}

.login-header p {
    color: var(--muted);
    font-size: 15px;
}

.stack-form {
    display: grid;
    gap: 10px;
}

.stack-form label {
    font-weight: bold;
    margin-top: 4px;
}

.password-wrap {
    position: relative;
}

.password-wrap input {
    padding-right: 48px;
}

.password-toggle {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    border: none;
    background: transparent;
    cursor: pointer;
    font-size: 18px;
    line-height: 1;
}

.login-footer {
    margin-top: 18px;
    text-align: center;
}

.login-footer p {
    margin-bottom: 10px;
    color: var(--muted);
}

/* FORMS / UTILITIES */
.center-box {
    text-align: center;
    margin-bottom: 20px;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    border: 0;
}

/* FULLCALENDAR LIGHT TOUCH */
.fc .fc-toolbar-title {
    font-size: 1.35rem;
}

.fc .fc-button {
    background: var(--charcoal);
    border-color: var(--charcoal);
}

.fc .fc-button:hover,
.fc .fc-button:focus {
    background: #000;
    border-color: #000;
}

.fc .fc-button-primary:not(:disabled).fc-button-active {
    background: var(--gold);
    border-color: var(--gold);
    color: #000;
}

/* MOBILE */
@media (max-width: 900px) {
    .dashboard-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .topbar {
        flex-direction: column;
        text-align: center;
        padding: 14px 16px;
    }

    .topbar-left,
    .topbar-right {
        width: auto;
        justify-content: center;
    }

    .container {
        padding: 0 14px 24px;
    }

    .dashboard-card,
    .action-panel,
    .preview-panel,
    .login-box {
        padding: 18px;
    }

    .action-buttons {
        flex-direction: column;
    }

    .btn {
        width: 100%;
    }

    .table {
        display: block;
        overflow-x: auto;
        white-space: nowrap;
    }
}