/* #############################################################################
#   solicus License Service
#   CSS Definitions
#
#   Copyright (c) 2025 solicus. All rights reserved.
############################################################################# */

/* #########################################################
    Global CSS Variables
######################################################### */
:root {
    --primary: #2980B9;
    --primary-light: #eaf4fb;
    --text: #222;
    --muted: #666;
    --bg: #f7f8fa;
    --card-bg: #fff;
    --radius: 10px;
    --border: #e1e4e8;
    --danger: #d32f2f;
    --danger-light: #fdecea;
}

/* #########################################################
    Base
######################################################### */
* {
    box-sizing: border-box
}

html, body {
    height: 100%
}

body {
    margin: 0;
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    color: var(--text);
    background: var(--bg);
    -webkit-text-size-adjust: 100%;
}

.page {
    min-height: 100vh;
    display: flex;
    flex-direction: column
}

main {
    flex: 1;  /* Takes all available space, pushing footer to bottom */
    padding-bottom: 40px;  /* Gap between content and footer */
}

/* Shared content container to keep width consistent across sections */
.container {
    max-width: 1040px;
    margin: 0 auto;
    padding-left: 20px;
    padding-right: 20px;
}

@media (max-width: 600px) {
    .container {
        padding-left: 16px;
        padding-right: 16px;
    }
}

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

a:hover {
    text-decoration: underline
}

code, kbd, pre, samp {
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace
}

/* -------- Header -------- */
header {
    background: #fff;
    border-bottom: 1px solid var(--border);
}

.header-inner {
    padding-top: 10px;
    padding-bottom: 10px;
    /* horizontal padding comes from .container */
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
}

.brand {
    display: flex;
    align-items: center;
}

.brand-link {
    display: inline-flex;
    align-items: center;
    text-decoration: none;
    line-height: 1;
}

.brand-image {
    height: 32px;
    width: auto;
    display: block;
}

/* -------- Main Navigation -------- */
.nav {
    display: flex;
    align-items: center;
    gap: 16px;
}

.nav-link {
    font-size: 14px;
    font-weight: 500;
    color: var(--text);
    text-decoration: none;
    padding: 8px 12px;
    border-radius: var(--radius);
}

.nav-link:hover {
    background: #eef2f6;
    color: var(--text);
    text-decoration: none;
}

.header-link {
    font-size: 13px;
    color: var(--primary);
    text-decoration: none;
    white-space: nowrap;
}

.header-link:hover {
    text-decoration: underline;
}

@media (max-width: 700px) {
    .header-inner {
        flex-wrap: wrap;
        gap: 10px;
    }

    .nav {
        order: 3;
        width: 100%;
        justify-content: flex-start;
        flex-wrap: wrap;
    }

    .header-link {
        margin-left: auto;
    }
}

/* -------- Footer -------- */
footer {
    border-top: 1px solid var(--border);
    background: #fff
}

.footer-inner {
    padding-top: 12px;
    padding-bottom: 12px;
    /* horizontal padding comes from .container */
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 10px;
    font-size: 12px;
    color: var(--muted);
    align-items: center;
}

.footer-link {
    font-size: inherit;      /* match footer text size */
    color: inherit;          /* match footer text color */
    text-decoration: none;
}

.footer-link:hover {
    text-decoration: underline; /* simple, site-consistent hover */
}

/* Keep generic footer anchor rules minimal */
.footer-inner a {
    line-height: 1;
}

/* -------- Hero -------- */
.hero {
    padding: 36px 0 16px;
}

.hero-inner {
    /* Keep hero aligned with other sections */
    width: 100%;
}

.hero-eyebrow {
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: .09em;
    color: var(--muted);
    margin-bottom: 6px
}

.hero-title {
    font-size: 28px;
    margin: 0 0 10px
}

.hero-subtitle {
    max-width: 640px;
    font-size: 15px;
    color: var(--muted);
    margin: 0
}

.badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 2px 8px;
    border-radius: 999px;
    background: var(--primary-light);
    color: var(--primary);
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .08em
}

/* -------- Content Grid (Home page only) -------- */
.content {
    padding: 8px 0 40px;
}

.content-inner {
    width: 100%;
    display: grid;
    grid-template-columns:minmax(0, 2fr) minmax(0, 1fr);
    gap: 20px;
    align-items: flex-start
}

@media (max-width: 900px) {
    .content-inner {
        grid-template-columns:minmax(0, 1fr)
    }
}

/* Home page: keep 2-card grid, but don't change container padding */
.home-content {
    padding: 0;
}

/* -------- Cards -------- */
.card,
.doc-content {
    background: var(--card-bg);
    border-radius: var(--radius);
    padding: 18px 18px 16px;
    box-shadow: 0 6px 16px rgba(0, 0, 0, .04);
    border: 1px solid #e2e6ea;
    overflow: hidden;
}

.card h2 {
    font-size: 18px;
    margin: 0 0 10px
}

.card h3 {
    font-size: 15px;
    margin: 18px 0 6px
}

.card p {
    font-size: 14px;
    margin: 0 0 8px;
    color: var(--muted)
}

.card ul {
    margin: 4px 0 10px 18px;
    padding: 0;
    font-size: 14px;
    color: var(--muted)
}

.card li {
    margin-bottom: 4px
}

/* -------- Labels -------- */
.muted-label {
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: .08em;
    color: var(--muted);
    margin-bottom: 4px
}

/* -------- Document Pages -------- */
/* Generic document page layout (used by legal notice, privacy policy, contact, etc.) */
.doc {
    padding: 24px 0 40px; /* horizontal padding comes from .container */
}

.doc-content {
    width: 100%;
}

.doc h1 {
    font-size: 26px;
    margin: 0 0 10px;
}

.doc h2 {
    font-size: 16px;
    margin: 20px 0 8px;
}

.doc p,
.doc li {
    font-size: 14px;
    color: var(--muted);
    line-height: 1.6;
}

.doc address {
    font-style: normal;
    font-size: 14px;
    color: var(--muted);
    line-height: 1.6;
    margin: 0;
}

@media (max-width: 600px) {
    .doc {
        padding: 16px 0 32px;
    }

    .doc-content {
        padding: 16px;
    }

    .doc h1 {
        font-size: 22px;
    }
}

/* -------- Helpers -------- */
.hidden {
    display: none !important
}

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

.text-danger {
    color: #b00020
}

/* #########################################################
    UI
######################################################### */
.dashboard-shell {
    max-width: 1040px;
    margin: 0 auto;
    padding: 20px;
}

.dashboard-grid {
    display: grid;
    grid-template-columns:220px minmax(0, 1fr);
    gap: 24px;
    align-items: flex-start;
}

@media (max-width: 900px) {
    .dashboard-grid {
        grid-template-columns:minmax(0, 1fr);
    }
}

/* -------- Sidebar -------- */
.sidebar {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 16px;
}

.sidebar h3 {
    margin: 0 0 12px;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: .06em;
    color: var(--muted);
}

.sidebar-nav {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.sidebar-nav a {
    display: block;
    padding: 8px 10px;
    border-radius: 6px;
    font-size: 14px;
    color: var(--text);
    text-decoration: none;
    font-weight: 500;
}

.sidebar-nav a:hover {
    background: var(--bg);
}

.sidebar-nav a.nav-active {
    background: var(--bg);
    font-weight: 600;
}

/* -------- Auth Layout -------- */
.auth-container {
    min-height: calc(100vh - 120px);
    display: flex;
    justify-content: center;
    padding-top: 80px;
    padding-bottom: 40px;
    padding-left: 20px;
    padding-right: 20px;
}

.auth-card {
    width: 400px;
    max-width: 100%;
    margin: 0 auto
}

/* -------- Tables (dashboard) -------- */
table {
    width: 100%;
    border-collapse: collapse
}

th, td {
    padding: 10px;
    border-bottom: 1px solid #edf1f4;
    text-align: left;
    font-size: 14px
}

thead th {
    font-weight: 600;
    color: #333;
    background: #fafbfc
}

/* Table wrapper for horizontal scrolling */
.table-wrapper {
    overflow-x: auto;
    margin: 0 -18px;
    padding: 0 18px;
}

.table-wrapper table {
    min-width: 100%;
}

/* Responsive table adjustments */
@media (max-width: 900px) {
    .table-col-optional {
        display: none;
    }
}

@media (max-width: 600px) {
    th, td {
        padding: 8px;
        font-size: 13px;
    }
}

/* -------- Table Actions -------- */
.table-actions {
    display: flex;
    gap: 6px;
    align-items: center;
    flex-wrap: wrap;
}
.table-actions form {
    margin: 0;
    display: flex;
}

/* -------- Table Toolbar  -------- */
.table-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
}
.toolbar-primary,
.toolbar-secondary {
    display: flex;
    align-items: center;
    gap: 8px;
}
@media (max-width: 600px) {
    .table-toolbar {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
    }
    .toolbar-primary,
    .toolbar-secondary {
        justify-content: flex-start;
        flex-wrap: wrap;
    }
}

/* -------- Buttons -------- */
button, .btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 8px 14px;
    border: 0;
    border-radius: var(--radius);
    background: var(--primary);
    color: #fff;
    font-weight: 600;
    font-size: 14px;
    line-height: 1;
    cursor: pointer;
    transition: all .15s ease;
    text-decoration: none;
    white-space: nowrap;
    vertical-align: middle;
}

button:hover, .btn:hover {
    filter: brightness(.95);
    text-decoration: none;
}

button:active, .btn:active {
    transform: translateY(1px);
}

.btn-secondary {
    background: #eef2f6;
    color: #1b2a3a;
    border: 1px solid #d6dde3;
}

.btn-secondary:hover {
    background: #e1e7ed;
    border-color: #c5cdd5;
}

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

.btn-danger:hover {
    background: #b71c1c;
}

/* Small button variant (optional for compact UIs) */
.btn-sm {
    padding: 6px 10px;
    font-size: 13px;
}

/* -------- Forms -------- */
form label {
    font-size: 13px;
    color: #333;
    margin: 6px 0 4px;
    display: inline-block
}

input[type="email"], input[type="password"], input[type="text"], input[type="date"], input[type="number"], select, textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #d6dde3;
    border-radius: 8px;
    background: #fff;
    font-size: 14px;
    outline: none;
    transition: border-color .15s ease
}

textarea {
    font-family: inherit;
    resize: vertical;
}

input:focus, select:focus, textarea:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(41, 128, 185, .12)
}

/* -------- Notification Banners -------- */
.notification {
    padding: 12px 16px;
    border-radius: 8px;
    margin-bottom: 16px;
    font-size: 14px;
    font-weight: 500;
    border-left: 4px solid;
}

.notification-success {
    background: #e8f5e9;
    color: #2e7d32;
    border-left-color: #4caf50;
}

.notification-error {
    background: #ffebee;
    color: #c62828;
    border-left-color: #f44336;
}

.notification-info {
    background: #e3f2fd;
    color: #1565c0;
    border-left-color: #2196f3;
}

.notification-warning {
    background: #fff3e0;
    color: #e65100;
    border-left-color: #ff9800;
}

/* -------- License Status Badges -------- */
.status-badge {
    display: inline-flex;
    align-items: center;
    padding: 2px 8px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .06em;
}

.status-active {
    background: #e6f4ea;
    color: #1b5e20;
}

.status-expired {
    background: #fdecea;
    color: #b71c1c;
}

.status-revoked {
    background: #fff4e5;
    color: #8a4b08;
}

.status-assigned {
    background: #eef2f7;
    color: #374151;
}

.status-unassigned {
    background: #f5f5f5;
    color: #616161;
}

.status-invited {
    background: #e3f2fd;
    color: #1565c0;
}
